-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
.pre-commit-config.yaml
202 lines (185 loc) · 4.21 KB
/
.pre-commit-config.yaml
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
---
ci:
autoupdate_schedule: quarterly
repos:
- repo: https://github.com/asottile/add-trailing-comma.git
rev: v3.1.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/PyCQA/isort.git
rev: 5.13.2
hooks:
- id: isort
args:
- --honor-noqa
files: >-
^.*\.p(xd|y|yx)$
types: [file]
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.5.5
hooks:
- id: remove-tabs
- repo: https://github.com/pre-commit/pygrep-hooks.git
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: rst-backticks
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.6.0
hooks:
# Side-effects:
- id: trailing-whitespace
- id: check-merge-conflict
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: requirements-txt-fixer
exclude: >-
^(docs/requirements|requirements-build)\.txt$
# Non-modifying checks:
- id: name-tests-test
files: >-
^tests/[^_].*\.py$
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
# disabled due to pre-commit/pre-commit-hooks#159
# - id: check-docstring-first
- id: check-json
- id: check-symlinks
- id: check-yaml
- id: detect-private-key
# Heavy checks:
- id: check-ast
exclude: >-
^docs/_samples/.*\.py$
- id: debug-statements
exclude: >-
^docs/_samples/.*\.py$
- repo: https://github.com/PyCQA/pydocstyle.git
rev: 6.3.0
hooks:
- id: pydocstyle
exclude: >-
^docs/_samples/.*\.py$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
args:
- --strict
- repo: https://github.com/PyCQA/flake8.git
rev: 7.1.0
hooks:
- id: flake8
alias: flake8-no-wps
name: flake8 WPS-excluded
additional_dependencies:
- flake8-2020 ~= 1.7.0
- flake8-length ~= 0.3.0
- flake8-logging-format ~= 0.7.5
- flake8-pytest-style ~= 1.6.0
exclude: >-
^docs/_samples/.*\.py$
files: >-
^.*\.p(xd|y|yx)$
language_version: python3
types:
- file
- repo: https://github.com/PyCQA/flake8.git
rev: 7.1.0
hooks:
- id: flake8
alias: flake8-only-wps
name: flake8 WPS-only
args:
# https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
- --format
- wemake
- --select
- WPS
additional_dependencies:
- wemake-python-styleguide ~= 0.19.2
exclude: >-
^docs/_samples/.*\.py$
files: >-
^.*\.p(xd|y|yx)$
language_version: python3.11 # flake8-commas doesn't work w/ Python 3.12
types:
- file
- repo: https://github.com/MarcoGorelli/cython-lint.git
rev: v0.16.2
hooks:
- id: cython-lint
# NOTE: This linter does not have a config file so it's set up below.
args:
- --max-line-length
- '160' # matches a similar value in the .flake8 config
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup.git
rev: v1.0.1
hooks:
- id: rst-linter
files: >-
^README\.rst$
- repo: local
hooks:
- id: changelogs-rst
name: changelog filenames
language: fail
entry: >-
Changelog files must be named
####.(
bugfix
| feature
| deprecation
| breaking
| doc
| packaging
| contrib
| misc
)(.#)?(.rst)?
exclude: >-
(?x)
^
docs/changelog-fragments/(
\.gitignore
|(\d+|[0-9a-f]{8}|[0-9a-f]{7}|[0-9a-f]{40})\.(
bugfix
|feature
|deprecation
|breaking
|doc
|packaging
|contrib
|misc
)(\.\d+)?(\.rst)?
|README\.rst
|template\.j2
)
$
files: ^docs/changelog-fragments/
types: []
types_or:
- file
- symlink
- id: changelogs-user-role
name: Changelog files should use a non-broken :user:`name` role
language: pygrep
entry: :user:([^`]+`?|`[^`]+[\s,])
pass_filenames: true
types:
- file
- rst
# - repo: local
# hooks:
# - id: pylint
# language: system
# name: PyLint
# files: \.py$
# entry: python -m pylint
# args: []
...