-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
175 lines (159 loc) · 4.96 KB
/
.pre-commit-config.yaml
File metadata and controls
175 lines (159 loc) · 4.96 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
fail_fast: true
default_language_version:
python: "3.13"
default_install_hook_types:
- commit-msg
- pre-commit
- pre-push
exclude: |
(?x)
.*-lock\..* |
.*\.lock$ |
.*example.* |
cspell\.txt |
.*/samples/.* |
repos:
# --------------- [ check-github-workflows | check-taskfile ] ----------------
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.33.3
hooks:
- id: check-github-workflows
args: [--verbose]
- id: check-taskfile
# ------------------------------ [ commitizen ] ------------------------------
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.8.3
hooks:
- id: commitizen
stages: [commit-msg]
- id: commitizen-branch
stages: [manual]
# -------------------------------- [ cspell ] --------------------------------
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v9.2.0
hooks:
- id: cspell
name: "check spelling: workspace files"
args:
- --config
- cspell.config.jsonc
- --no-summary
- --no-progress
- --no-must-find-files
- id: cspell
name: "check spelling: commit message"
args:
- --config
- cspell.config.jsonc
- --no-must-find-files
- --no-progress
- --no-summary
- --files
- .git/COMMIT_EDITMSG
stages: [commit-msg]
always_run: true
# ---------------------------- [ gitignore-tidy ] ----------------------------
- repo: https://github.com/lorenzwalthert/gitignore-tidy
rev: 0.1.2
hooks:
- id: tidy-gitignore
# ------------------------------- [ gitleaks ] -------------------------------
- repo: https://github.com/gitleaks/gitleaks
rev: v8.28.0
hooks:
- id: gitleaks
# ------------------------------- [ mdformat ] -------------------------------
- repo: https://github.com/hukkin/mdformat
rev: 0.7.22
hooks:
- id: mdformat
additional_dependencies:
- mdformat-config
- mdformat-footnote
- mdformat-frontmatter
- mdformat-gfm
- mdformat-gfm-alerts
- mdformat-mkdocs
- mdformat-pyproject
- mdformat-ruff
- mdformat-shfmt
- mdformat-simple-breaks
- mdformat-tables
- mdformat-web
- mdformat-wikilink
- ruff
# ------------------------------ [ pre-commit ] ------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: check-case-conflict
- id: check-merge-conflict
- id: debug-statements
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=auto]
- id: check-added-large-files
args: [--maxkb=8192]
# ------------------------------- [ pyright ] --------------------------------
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.404
hooks:
- id: pyright
stages: [pre-push]
# -------------------------------- [ pytest ] --------------------------------
- repo: local
hooks:
- id: pytest
name: pytest
entry: >
sh -c 'if [ ! -x ".venv/bin/pytest" ]; then
echo "Skipping - pytest not found."
elif ! command -v find >/dev/null 2>&1; then
echo "Skipping - command not found: find"
else
found="$(find . -iname "*test*.py" \
-not -ipath "**/.venv/**" \
-not -ipath "**/node_modules/**" \
-not -ipath "**/*data*/" \
-not -ipath ".*" -print)"
if [ "$found" != "" ]; then
".venv/bin/pytest"
fi
fi'
language: system
types: [python]
stages: [pre-push]
pass_filenames: false
always_run: true
# --------------------------------- [ ruff ] ---------------------------------
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.12.11
hooks:
- id: ruff-check
types_or: [python, pyi]
args: [--fix]
- id: ruff-format
types_or: [python, pyi]
# -------------------------------- [ taplo ] ---------------------------------
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-lint
- id: taplo-format
# -------------------------- [ validate-pyproject ] --------------------------
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
- id: validate-pyproject
additional_dependencies: ["validate-pyproject-schema-store[all]"]
# ------------------------------- [ yamlfmt ] --------------------------------
- repo: https://github.com/google/yamlfmt
rev: v0.17.2
hooks:
- id: yamlfmt