-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
116 lines (113 loc) · 3.34 KB
/
.pre-commit-config.yaml
File metadata and controls
116 lines (113 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
default_language_version:
python: python3
fail_fast: true
minimum_pre_commit_version: "1.14.0"
repos:
# lint reST-files
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.9.1
hooks:
- id: sphinx-lint
- repo: https://github.com/pycqa/doc8
rev: v1.1.1
hooks:
- id: doc8
# require some attributes in the content files
- repo: local
hooks:
- id: content_summary
name: All articles must have a summary
language: pygrep
entry: ":summary:"
args: [--negate]
files: ^content/
exclude: (index|404).rst|.gitkeep
- id: content_keywords
name: All articles must have keywords
language: pygrep
entry: ":keywords:"
args: [--negate]
files: ^content/
exclude: (index|404).rst|.gitkeep
- id: prettier
name: prettier (local)
entry: npx prettier --write --ignore-unknown
language: system
args: []
"types": [text]
- id: stylelint
name: stylelint (local)
entry: npx stylelint
language: system
args: [--fix]
files: ^theme/mischback/_src/style/
# various Python-related hooks
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
# prohibit blank "noqa"
- id: python-check-blanket-noqa
# eval() is evil
- id: python-no-eval
# black (Python: code formatting)
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
# isort (Python: automatically sort import statements)
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
# flake8 (linting)
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
# https://github.com/PyCQA/flake8-bugbear
- flake8-bugbear
# https://github.com/adamchainz/flake8-comprehensions
- flake8-comprehensions
# https://github.com/PyCQA/flake8-docstrings
- flake8-docstrings
# https://github.com/globality-corp/flake8-logging-format
- flake8-logging-format
# lint templates
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.34.1
hooks:
- id: djlint-jinja
files: ^theme/mischback/
types_or: ["html"]
- repo: https://github.com/thibaudcolas/curlylint
rev: v0.13.1
hooks:
- id: curlylint
files: ^theme/mischback/
types_or: ["html"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# check scripts to have shebangs
- id: check-executables-have-shebangs
# check JSON files
- id: check-json
# check TOML files
- id: check-toml
# check YAML files
- id: check-yaml
# check links to GitHub
- id: check-vcs-permalinks
# let all files end with a single new line (this *should be ensured by
# .editorconfig already)
- id: end-of-file-fixer
# remove all trailing whitespaces (this *should* be ensured by
# .editorconfig already)
- id: trailing-whitespace
# provide uniform line endings for the project ('lf'; this *should be
# ensured by .editorconfig already)
- id: mixed-line-ending
args: [--fix, lf]
# remove utf-8 byte order marker
- id: fix-byte-order-marker