-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
206 lines (170 loc) · 5.41 KB
/
.pre-commit-config.yaml
File metadata and controls
206 lines (170 loc) · 5.41 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
# Configuration-file for pre-commit
#
# References:
# - Official docs: https://pre-commit.com
# - for more hooks: https://pre-commit.com/hooks.html
# - https://github.com/pre-commit/pre-commit-hooks
#
# Notes:
# - To avoid duplication, we try to configure the tools in pyproject.toml as much as possible.
# - The setting "language: system" is used to run commands that are already available on your system,
# and pre-commit does not need to create or manage an isolated environment.
# - Single-quote regular expressions.
#
# Usage:
# > bin/pre-commit install
# > bin/pre-commit install hooks -f
# > bin/pre-commit autoupdate
# > bin/pre-commit run --all-files
default_install_hook_types: [commit-msg, pre-commit]
default_stages: [pre-commit, manual]
default_language_version:
python: python3.10
fail_fast: true
repos:
# - repo: https://github.com/pre-commit/pygrep-hooks
# rev: v1.10.0
# hooks:
# - id: python-check-mock-methods
# - id: python-use-type-annotations
# - id: rst-backticks
# - id: rst-directive-colons
# - id: rst-inline-touching-normal
# - id: text-unicode-replacement-char
- repo: local
hooks:
# The following are all pre-commit-hooks
# docs: https://github.com/pre-commit/pre-commit-hooks
# - id: lower-case-only
# name: check filenames are lower-case
# entry: check forbidden filenames
# language: fail
# files: '[^a-z0-9._/-]'
- id: check-added-large-files
name: check added large files
entry: uv run check-added-large-files
language: system
- id: check-case-conflict
name: check case conflicts
description: Check for files with names that would conflict on a case-insensitive filesystem.
entry: uv run check-case-conflict
language: system
- id: check-merge-conflict
name: check merge conflict
entry: uv run check-merge-conflict
args: [--assume-in-merge]
language: system
- id: check-shebang-scripts-are-executable
name: check shebang scripts are executable
entry: uv run check-shebang-scripts-are-executable
language: system
- id: check-json
name: check json
entry: uv run check-json
language: system
types: [json]
exclude: '^.vscode/.*\.json'
- id: check-toml
name: check toml syntax
entry: uv run check-toml
language: system
types: [toml]
- id: check-xml
name: check xml syntax
entry: uv run check-xml
language: system
types: [xml]
- id: check-yaml
name: check yaml syntax
entry: check-yaml
language: system
types: [yaml]
- id: check-symlinks
name: check symlinks
entry: uv run check-symlinks
language: system
- id: destroyed-symlinks
name: destroyed symlinks
entry: uv run destroyed-symlinks
language: system
- id: detect-private-key
name: detect private key
entry: uv run detect-private-key
language: system
- id: fix-byte-order-marker
name: fix byte order marker
entry: uv run fix-byte-order-marker
language: system
- id: mixed-line-ending
name: fix mixed line ending (CLRF/LF)
entry: uv run mixed-line-ending
language: system
types: [text]
- id: trailing-whitespace
name: fix trailing whitespace (EOL)
entry: uv run trailing-whitespace-fixer
language: system
types: [text]
# Below python-specific checks
- id: check-ast
name: check ast
entry: uv run check-ast
language: system
types: [python]
- id: check-builtin-literals
name: check builtin literals
entry: uv run check-builtin-literals
language: system
types: [python]
- id: check-docstring-first
name: check docstring first
entry: uv run check-docstring-first
language: system
types: [python]
- id: debug-statements
name: check debug statements
entry: uv run debug-statement-hook
language: system
types: [python]
- id: end-of-file-fixer
name: fix end of files (EOF)
entry: uv run end-of-file-fixer
language: system
types: [python]
- id: name-tests-test
name: pytests are prefixed tests_*.py
entry: uv run name-tests-test
args: [--pytest-test-first]
language: system
types: [python]
files: '^tests/.*\.py$'
exclude: '^tests/_helpers/.*\.py$'
- id: ruff-format
name: ruff format
entry: uv run ruff format
language: system
types: [python]
- id: ruff-check
name: ruff check
entry: uv run ruff check
args: [--fix]
language: system
types: [python]
- id: ty-check
name: ty check
entry: uv run ty check src/
language: system
types: [python]
pass_filenames: false
- id: mdformat
name: mdformat
description: format markdown files
entry: uv run mdformat
language: system
types: [markdown]
- id: uv-lock-check
name: uv lock check
description: check uv.lock is in sync
entry: uv lock --check
language: system
pass_filenames: false