-
-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
158 lines (153 loc) · 3.55 KB
/
.pre-commit-config.yaml
File metadata and controls
158 lines (153 loc) · 3.55 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
---
ci:
autoupdate_schedule: quarterly
repos:
- repo: https://github.com/python-jsonschema/check-jsonschema.git
rev: 0.32.1
hooks:
- id: check-github-workflows
files: ^\.github/workflows/[^/]+$
types:
- yaml
- id: check-jsonschema
alias: check-github-workflows-timeout
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/adrienverge/yamllint.git
rev: v1.37.0
hooks:
- id: yamllint
args:
- --strict
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.8
hooks:
- id: ruff-check
args: ["--fix"]
exclude: >-
(?x)
^
tools/upgrade_pythoncapi\.py
$
- id: ruff-format
exclude: >-
(?x)
^
tools/upgrade_pythoncapi\.py
$
- repo: local
hooks:
- id: top-level-tests-init-py
name: there must be not top-level `__init__.py` in `tests/`
language: fail
entry: >-
The `tests/__init__.py` module must not exist so `pytest` doesn't add the
project root to `sys.path` / `$PYTHONPATH`
files: >-
(?x)
^
tests/__init__\.py
$
types: []
types_or:
- file
- symlink
- 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)
^
CHANGES/(
\.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\.rst
)
$
files: ^CHANGES/
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/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
- id: clang-format
types_or: [c, c++]
- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.15.0
hooks:
- id: mypy
alias: mypy-py313
name: MyPy, for Python 3.13
additional_dependencies:
- types-docutils
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- pytest >= 8.4.0
- pytest_codspeed
- Sphinx >= 5.3.0
- sphinxcontrib-spelling
- types-psutil
- psutil
args:
- --python-version=3.13
- --txt-report=.tox/.tmp/.mypy/python-3.13
- --cobertura-xml-report=.tox/.tmp/.mypy/python-3.13
- --html-report=.tox/.tmp/.mypy/python-3.13
pass_filenames: false
- id: mypy
alias: mypy-py311
name: MyPy, for Python 3.11
additional_dependencies:
- types-docutils
- lxml # dep of `--txt-report`, `--cobertura-xml-report` & `--html-report`
- pytest >= 8.4.0
- pytest_codspeed
- Sphinx >= 5.3.0, < 8.0.0 # Sphinx 8 requires Python 3.12+
- sphinxcontrib-spelling
- types-psutil
- psutil
args:
- --python-version=3.11
- --txt-report=.tox/.tmp/.mypy/python-3.11
- --cobertura-xml-report=.tox/.tmp/.mypy/python-3.11
- --html-report=.tox/.tmp/.mypy/python-3.11
pass_filenames: false
...