-
-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
342 lines (320 loc) · 9.06 KB
/
.pre-commit-config.yaml
File metadata and controls
342 lines (320 loc) · 9.06 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
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
---
ci:
autoupdate_schedule: quarterly
repos:
- 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.d/(
\.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
|\.towncrier-template\.rst\.j2
)
$
files: ^docs/changelog-fragments\.d/
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: https://github.com/Kludex/no-optional.git
rev: 0.4.0
hooks:
- id: no_optional
- repo: https://github.com/astral-sh/ruff-pre-commit.git
rev: v0.13.3
hooks:
- id: ruff
args:
# Ref: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
- --fix # NOTE: When `--fix` is used, linting should be before ruff-format
- repo: https://github.com/astral-sh/ruff-pre-commit.git
rev: v0.13.3
hooks:
- id: ruff-format
alias: ruff-format-first-pass
name: ruff-format (first pass)
- repo: https://github.com/asottile/add-trailing-comma.git
rev: v3.2.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/astral-sh/ruff-pre-commit.git
rev: v0.13.3
hooks:
- id: ruff-format
alias: ruff-format-second-pass
name: ruff-format (second pass)
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.5.5
hooks:
- id: remove-tabs
- repo: https://github.com/python-jsonschema/check-jsonschema.git
rev: 0.34.0
hooks:
- id: check-github-workflows
files: ^\.github/workflows/[^/]+$
types:
- yaml
- id: check-jsonschema
name: Check GitHub Workflows set timeout-minutes
args:
- --builtin-schema
- github-workflows-require-timeout
files: ^\.github/workflows/[^/]+$
types:
- yaml
- id: check-readthedocs
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup.git
rev: v1.0.1
hooks:
- id: rst-linter
exclude: >-
(?x)
\.github/CONTRIBUTING\.rst
|
CHANGES\.rst
|
docs/
files: >-
^.*\.rst$
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v6.0.0
hooks:
# Side-effects:
- id: trailing-whitespace
- id: check-merge-conflict
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: fix-byte-order-marker
# disabled because it doesn't make sense to change pip-tools-managed files
# - id: requirements-txt-fixer
# exclude: >-
# (?x)
# ^
# dependencies/[^/]+.txt
# $
# files: >-
# (?x)
# ^
# dependencies/[^/]+.in
# $
# Non-modifying checks:
- id: name-tests-test
args:
- --django
exclude: cheroot/test/(helper|webtest|_pytest_plugin|threadleakcheck).py
files: cheroot/test/.+\.py$
- id: check-added-large-files
- 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
args:
- --unsafe
- id: detect-private-key
# Heavy checks:
- id: check-ast
- id: debug-statements
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.1
hooks:
- id: yamllint
types:
- file
- yaml
args:
- --strict
- repo: https://github.com/PyCQA/flake8.git
rev: 7.3.0
hooks:
- id: flake8
additional_dependencies:
- darglint ~= 1.8.1
- flake8-2020 ~= 1.8.1
- flake8-annotations ~= 3.2.0
- flake8-length ~= 0.3.1
- flake8-logging-format ~= 2024.24.12
- flake8-pytest-style ~= 2.2.0
- flake8-spellcheck ~= 0.28.0
- flake8-typing-as-t ~= 1.1.0
- wemake-python-styleguide ~= 1.4.0
types: []
types_or:
- python
- pyi
# `flake8-logging-format` is incompatible with Python 3.12+
# * https://github.com/globality-corp/flake8-logging-format/issues/80
#
language_version: python3.11
- repo: https://github.com/Lucas-C/pre-commit-hooks-lxml.git
rev: v1.1.0
hooks:
- id: forbid-html-img-without-alt-text
- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.18.2
hooks:
- id: mypy
alias: mypy-py314
name: MyPy, for Python 3.14
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
args:
- --python-version=3.14
- --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.14
- --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.14
- --html-report=.tox/.tmp/.test-results/mypy--py-3.14
- --linecount-report=.tox/.tmp/.test-results/mypy--py-3.14
- --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.14
- --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.14
- --txt-report=.tox/.tmp/.test-results/mypy--py-3.14
pass_filenames: false
- id: mypy
alias: mypy-py312
name: MyPy, for Python 3.12
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- types-backports
- types-pyOpenSSL
- types-requests
args:
- --python-version=3.12
- --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.12
- --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.12
- --html-report=.tox/.tmp/.test-results/mypy--py-3.12
- --linecount-report=.tox/.tmp/.test-results/mypy--py-3.12
- --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.12
- --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.12
- --txt-report=.tox/.tmp/.test-results/mypy--py-3.12
pass_filenames: false
- id: mypy
alias: mypy-py310
name: MyPy, for Python 3.10
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- types-backports
- types-pyOpenSSL
- types-requests
args:
- --python-version=3.10
- --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.10
- --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.10
- --html-report=.tox/.tmp/.test-results/mypy--py-3.10
- --linecount-report=.tox/.tmp/.test-results/mypy--py-3.10
- --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.10
- --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.10
- --txt-report=.tox/.tmp/.test-results/mypy--py-3.10
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.14.1 # the last MyPy version to support Python 3.8
hooks:
- id: mypy
alias: mypy-py38
name: MyPy 1.14.1, for Python 3.8
additional_dependencies:
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- types-backports
- types-pyOpenSSL
- types-requests
args:
- --python-version=3.8
- --any-exprs-report=.tox/.tmp/.test-results/mypy--py-3.8
- --cobertura-xml-report=.tox/.tmp/.test-results/mypy--py-3.8
- --html-report=.tox/.tmp/.test-results/mypy--py-3.8
- --linecount-report=.tox/.tmp/.test-results/mypy--py-3.8
- --linecoverage-report=.tox/.tmp/.test-results/mypy--py-3.8
- --lineprecision-report=.tox/.tmp/.test-results/mypy--py-3.8
- --txt-report=.tox/.tmp/.test-results/mypy--py-3.8
- cheroot/
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.18.2
hooks:
- id: mypy
alias: mypy-stubtest
name: MyPy stubtest
additional_dependencies:
- .
- jaraco.functools
- pyOpenSSL
# FIXME: Python 3.13+ causes a lot of
# FIXME: __firstlineno__/__static_attributes__ is not present in stub
language_version: python3.12
entry: python -m mypy.stubtest
args:
- cheroot
- --mypy-config-file=.mypy.ini
- --allowlist=stubtest_allowlist.txt
pass_filenames: false
types_or:
- python
- text
files: >-
(?x)
^
(
.*\.pyi?
|
cheroot/py\.typed
|
stubtest_allowlist\.txt
)
$
- repo: https://github.com/PyCQA/pylint.git
rev: v3.3.9
hooks:
- id: pylint
additional_dependencies:
- jaraco.context
- jaraco.functools
- jaraco.text
- more_itertools
- portend
- pylint-pytest ~= 2.0.0a0
- pyOpenSSL # needed by pylint-pytest since it picks up pytest's args
- pypytools
- pytest-cov # needed by pylint-pytest since it picks up pytest's args
- pytest-mock # needed by pylint-pytest since it picks up pytest's args
- >- # needed by pylint-pytest since it picks up pytest's args
pytest-rerunfailures
- pytest-xdist # needed by pylint-pytest since it picks up pytest's args
- requests_toolbelt
- requests_unixsocket
- Sphinx
- trustme # needed by pylint-pytest since it picks up pytest's args
...