-
-
Notifications
You must be signed in to change notification settings - Fork 661
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
187 lines (181 loc) · 5.62 KB
/
.pre-commit-config.yaml
File metadata and controls
187 lines (181 loc) · 5.62 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
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
hooks:
- id: black
args: [--target-version=py39]
- repo: https://github.com/PyCQA/isort
rev: 8.0.1
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/python-jsonschema/check-jsonschema.git
rev: 0.37.1
hooks:
- id: check-github-actions
- id: check-github-workflows
- id: check-jsonschema
alias: enforce-gha-timeouts
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/PyCQA/flake8
rev: 7.3.0
hooks:
- id: flake8
additional_dependencies:
- flake8-pytest-style == 2.2.0
- flake8-typing-as-t == 1.1.0
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.20.0
hooks:
- id: mypy
# Avoid error: Duplicate module named 'setup'
# https://github.com/python/mypy/issues/4008
# Keep exclude in sync with mypy own excludes
exclude: ^tests/test_data/
additional_dependencies:
- click==8.0.1
- pep517==0.10.0
- toml==0.10.2
- pip==20.3.4
- build==1.0.0
- pyproject_hooks==1.0.0
- pytest==7.4.2
- repo: https://github.com/PyCQA/bandit
rev: 1.9.4
hooks:
- id: bandit
args: [--ini, .bandit]
exclude: ^tests/
- repo: local
hooks:
- id: changelogs-md
name: changelog filenames
language: fail
entry: >-
Changelog files must be named
####.(
highlights
| bugfix
| feature
| deprecation
| breaking
| doc
| packaging
| contrib
| misc
| afterword
)(.#)?(.md)?
exclude: >-
(?x)
^
changelog.d/(
\.gitignore
|\.towncrier_template\.md\.jinja
|\.draft_changelog_partial\.md
|README\.md
|(\d+|[0-9a-f]{8}|[0-9a-f]{7}|[0-9a-f]{40}|\+[^.]+)\.(
highlights
|bugfix
|feature
|deprecation
|breaking
|doc
|packaging
|contrib
|misc
|afterword
)(\.\d+)?(\.md)?
)
$
files: ^changelog\.d/
types: []
types_or:
- file
- symlink
- repo: https://github.com/rhysd/actionlint.git
rev: v1.7.12
hooks:
- id: actionlint
additional_dependencies:
# actionlint has a shellcheck integration which extracts shell scripts in `run:` steps from GitHub Actions
# and checks these with shellcheck.
# The integration only works if shellcheck is installed.
- "github.com/wasilibs/go-shellcheck/cmd/shellcheck@v0.11.1"
- repo: https://github.com/jackdewinter/pymarkdown.git
rev: v0.9.36
hooks:
- id: pymarkdown
alias: md-changelog
name: PyMarkdown (published change log)
args:
# NOTE: `no-emphasis-as-heading` trips on dates under version
# NOTE: titles. Wrapping the dates with `<time>`, OTOH, causes
# NOTE: `no-inline-html`. `no-duplicate-heading` is caused by
# NOTE: having the same change log categories under multiple
# NOTE: versions. Finally, `blanks-around-headings` and
# NOTE: `no-multiple-blanks` are caused by our towncrier template
# NOTE: injecting an additional visual separator line at the end
# NOTE: of each release — this behavior is desired.
- --disable-rules=blanks-around-headings,no-duplicate-heading,no-emphasis-as-heading,no-multiple-blanks
- scan
files: ^CHANGELOG\.md$
- id: pymarkdown
alias: md-changelog-fragments
name: PyMarkdown (change log fragments)
args:
# NOTE: Towncrier-processed change log fragments must not have
# NOTE: headings but `first-line-heading` demands the opposite.
- --disable-rules=first-line-heading
- scan
files: ^changelog\.d/(.*\..*|\.draft_changelog_partial)\.md$
- id: pymarkdown
alias: md-issue-pr-templates
name: PyMarkdown (issue and pull request templates)
args:
# NOTE: GitHub issue templates are YAML document sequences. The
# NOTE: first document is YAML and the second is markdown.
# NOTE: The beginning cannot adhere to the `first-line-heading`
# NOTE: requirement. The PR templates are pure Markdown but the
# NOTE: structure does not need a global heading since this role
# NOTE: is fulfilled by the PR title field.
- --disable-rules=first-line-heading
- scan
files: ^\.github/(ISSUE_TEMPLATE/[^/]*|PULL_REQUEST_TEMPLATE)\.md$
- id: pymarkdown
alias: md-generic
name: PyMarkdown (remaining)
exclude: >-
(?x)
^
(
\.github/(ISSUE_TEMPLATE/[^/]*|PULL_REQUEST_TEMPLATE)\.md
|changelog\.d/(
\.draft_changelog_partial\.md
|(\d+|[0-9a-f]{8}|[0-9a-f]{7}|[0-9a-f]{40}|\+[^.]+)\.(
highlights
|bugfix
|feature
|deprecation
|breaking
|doc
|packaging
|contrib
|misc
|afterword
)(\.\d+)?(\.md)?
)
|CHANGELOG\.md
)
$
...