-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
194 lines (192 loc) · 5.94 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
default_stages: [pre-commit]
ci:
autoupdate_commit_msg: 'chore(deps): pre-commit.ci autoupdate'
autoupdate_schedule: quarterly # We want to do updates via renovate since we can exclude hooks from being updated
autofix_commit_msg: 'style: pre-commit.ci fixes'
skip:
- poetry-lock
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: local
hooks:
- id: generate-hook-docs
name: generate hook docs
description: Generate markdown documentation for pre-commit hooks in README.md
entry: dev_tools/generate_hook_docs.py
language: python
files: (README.md|.pre-commit-hooks.yaml|dev_tools/generate_hook_docs.py)
additional_dependencies:
- pre-commit>=3.5.0
- repo: https://github.com/pre-commit/pre-commit
rev: v3.5.0
hooks:
- id: validate_manifest
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
rev: v1.6.1
hooks:
- id: check-pre-commit-ci-config
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=1024]
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-illegal-windows-names
- id: check-json
exclude: |
(?x)^(
.devcontainer/devcontainer.json|
.vscode/
)
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-vcs-permalinks
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
args: [--fix=lf]
- id: name-tests-test
args: [--pytest-test-first]
- id: no-commit-to-branch
args: [--branch, master]
- id: pretty-format-json
args: [--autofix]
exclude: |
(?x)^(
.devcontainer/devcontainer.json|
.vscode/
)
- id: trailing-whitespace
- repo: https://github.com/mattlqx/pre-commit-search-and-replace
rev: v1.1.8
hooks:
- id: search-and-replace
- repo: https://github.com/pre-commit/sync-pre-commit-deps
rev: v0.0.1 # Last version to support Python 3.8
hooks:
- id: sync-pre-commit-deps
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff-format
- id: ruff
- repo: https://github.com/python-poetry/poetry
rev: 1.8.5 # Last version to support Python 3.8
hooks:
- id: poetry-check
- id: poetry-lock
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
- id: text-unicode-replacement-char
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
- repo: https://github.com/MarcoGorelli/auto-walrus
rev: 0.3.4
hooks:
- id: auto-walrus
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: forbid-binary
always_run: true
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1 # Last version to support Python 3.8
hooks:
- id: toml-sort-fix
exclude: "\\.lock$"
- repo: https://github.com/google/yamlfmt
rev: v0.14.0
hooks:
- id: yamlfmt
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: [--strict]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.0 # Last version to support Python 3.8
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/PyCQA/docformatter
rev: eb1df347edd128b30cd3368dddc3aa65edcfac38 # Requires >v1.7.5
hooks:
- id: docformatter
args: [--in-place, --config, pyproject.toml]
additional_dependencies: [tomli==2.0.1]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
hooks:
- id: check-github-workflows
- id: check-renovate
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
rev: v1.7.6.22
hooks:
- id: actionlint
additional_dependencies: [pyflakes>=3.1.0, shellcheck-py>=0.9.0.5]
- repo: https://github.com/crate-ci/typos
rev: dictgen-v0.3.1
hooks:
- id: typos
exclude_types:
- svg
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17 # Last version to support Python 3.8
hooks:
- id: mdformat
additional_dependencies:
- linkify-it-py==1.0.3
- mdformat-gfm==0.3.5
- mdformat-myst==0.1.5
- mdformat-shfmt==0.1.0
- mdformat-config==0.1.3
- mdformat-toc==0.3.0
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0 # Last version to support Python 3.8
hooks:
- id: blacken-docs
args: [--line-length=120]
- repo: https://github.com/tcort/markdown-link-check
# Stick to 3.11.2 until https://github.com/tcort/markdown-link-check/issues/325 is fixed
rev: v3.11.2
hooks:
- id: markdown-link-check
args: ["--quiet", "--config", ".md-link-config.json"]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
args: ["--dot", "--fix"]
- repo: https://github.com/jendrikseipp/vulture
rev: v2.14
hooks:
- id: vulture
pass_filenames: true
# Enable once https://github.com/renovatebot/pre-commit-hooks/issues/2460 is resolved
# - repo: https://github.com/renovatebot/pre-commit-hooks
# rev: 38.77.3
# hooks:
# - id: renovate-config-validator