Skip to content

Commit 534d6f4

Browse files
ci: reorganize pre-commit hooks, add exclusions
1 parent 37eac4c commit 534d6f4

File tree

1 file changed

+40
-31
lines changed

1 file changed

+40
-31
lines changed

.pre-commit-config.yaml

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,43 @@ repos:
99
- repo: https://github.com/pre-commit/pre-commit-hooks
1010
rev: v5.0.0
1111
hooks:
12-
- id: check-yaml
13-
- id: check-added-large-files
14-
args: ['--maxkb=1024']
15-
- id: check-docstring-first
16-
exclude: |
17-
(?x)^(
18-
scratch.py
19-
)$
20-
- id: check-executables-have-shebangs
21-
- id: check-merge-conflict
22-
- id: check-shebang-scripts-are-executable
23-
- id: check-symlinks
24-
- id: check-toml
25-
- id: check-yaml
26-
args: [--unsafe]
27-
- id: debug-statements
28-
- id: destroyed-symlinks
29-
- id: detect-private-key
30-
- id: end-of-file-fixer
31-
- id: fix-byte-order-marker
32-
- id: mixed-line-ending
33-
- id: pretty-format-json
34-
# https://pre-commit.com/#regular-expressions
35-
exclude: |
36-
(?x)^(
37-
.devcontainer/devcontainer.json|
38-
.vscode/launch.json|
39-
.vscode/settings.json
40-
)$
41-
args: ['--autofix', '--indent=2', '--no-sort-keys']
42-
- id: requirements-txt-fixer
12+
- id: check-added-large-files
13+
args: ['--maxkb=1024']
14+
- id: check-executables-have-shebangs
15+
files: \.(py|sh)$
16+
- id: check-docstring-first
17+
files: \.(py)$
18+
exclude: |
19+
(?x)^(
20+
scratch.py
21+
)$
22+
- id: check-merge-conflict
23+
- id: check-shebang-scripts-are-executable
24+
files: \.(py|sh)$
25+
- id: check-symlinks
26+
- id: debug-statements
27+
- id: destroyed-symlinks
28+
- id: detect-private-key
29+
- id: end-of-file-fixer
30+
files: \.(py|sh)$
31+
- id: fix-byte-order-marker
32+
- id: mixed-line-ending
33+
files: \.(py|sh)$
34+
- id: requirements-txt-fixer
35+
files: requirements.txt
36+
- id: check-toml
37+
files: \.toml$
38+
- id: check-yaml
39+
args: [--unsafe]
40+
files: \.(yaml|yml)$
41+
- id: pretty-format-json
42+
# https://pre-commit.com/#regular-expressions
43+
args: ['--autofix', '--indent=2', '--no-sort-keys']
44+
files: \.(json|jsonc)$
45+
exclude: |
46+
(?x)^(
47+
.devcontainer/devcontainer.json|
48+
.vscode/launch.json|
49+
.vscode/settings.json|
50+
.vscode/extensions.json|
51+
)$

0 commit comments

Comments
 (0)