-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
197 lines (182 loc) · 6.77 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
197 lines (182 loc) · 6.77 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
repos:
# ── Hooks génériques ─────────────────────────────────────────────────────────
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: no-commit-to-branch
args: ['--branch', 'main']
stages: [pre-commit, commit-msg]
groups: [local]
- id: trailing-whitespace
exclude: \.md$
stages: [pre-commit]
groups: [local]
- id: end-of-file-fixer
stages: [pre-commit]
groups: [local]
- id: mixed-line-ending
args: ['--fix=lf']
stages: [pre-commit]
groups: [locals]
- id: check-json
stages: [pre-commit]
groups: [local,github-src]
- id: check-yaml
stages: [pre-commit]
groups: [local,github-src]
- id: check-merge-conflict
stages: [pre-commit]
groups: [local,github-src]
- id: check-added-large-files
stages: [pre-commit]
groups: [local,github-src]
- id: check-symlinks
stages: [pre-commit]
groups: [local,github-src]
- id: check-toml
stages: [pre-commit]
groups: [local,github-src]
- id: detect-private-key
stages: [pre-commit]
groups: [local,github-src]
# ── commitlint ────────────────────────────────────────────────────────────
- repo: local
hooks:
- id: commitlint
name: commitlint
entry: commitlint --edit
language: system
stages: [commit-msg]
groups: [local,github-src]
# ── dotenv-linter ────────────────────────────────────────────────────────────
- repo: local
hooks:
- id: dotenv-linter
name: dotenv-linter
entry: dotenv-linter check
language: system
stages: [pre-commit]
files: \.env(-example)?$
groups: [local,github-src]
# ── Fichiers interdits ───────────────────────────────────────────────────────
- repo: local
hooks:
- id: forbid-files
name: forbid-files
entry: "bash -c 'echo \"Forbidden file staged: $@\" >&2; exit 1' --"
language: system
stages: [pre-commit]
files: (^|/)\.env$|\.local$|\.pem$|\.key$|(^|/)\.vscode/settings\.json$|(^|/)local\.settings\.json$|(^|/)local\.config/
groups: [local,github-src]
# ── ShellCheck ───────────────────────────────────────────────────────────────
- repo: local
hooks:
- id: shellcheck
name: shellcheck
entry: uv run shellcheck -x
language: system
stages: [pre-commit]
types: [shell]
groups: [local,github-src]
# ── Python linters (src/) ────────────────────────────────────────────────────
- repo: local
hooks:
- id: ruff-lint-src
name: ruff-lint-src
entry: uv run ruff check
language: system
stages: [pre-commit]
types: [python]
files: ^src/
groups: [local,github-src]
- id: ruff-format-src
name: ruff-format-src
entry: uv run ruff format --check
language: system
stages: [pre-commit]
types: [python]
files: ^src/
groups: [local,github-src]
- id: pylint-src
name: pylint-src
entry: uv run pylint
language: system
stages: [pre-commit]
types: [python]
files: ^src/
groups: [local,github-src]
- id: pyright-src
name: pyright-src
entry: uv run pyright
language: system
stages: [pre-commit]
types: [python]
groups: [local,github-src]
# ── Docstring linters (src/) ──────────────────────────────────────────────────
- repo: local
hooks:
- id: docstring-linter-src
name: docstring-linter-src
entry: uv run docstring-linter
language: system
stages: [pre-commit]
types: [python]
files: ^src/
groups: [local,github-src]
# ── Python linters (tests/) ──────────────────────────────────────────────────
- repo: local
hooks:
- id: ruff-lint-tests
name: ruff-lint-tests
entry: uv run ruff check
language: system
stages: [pre-commit]
types: [python]
files: ^tests/
groups: [local,github-tests]
- id: ruff-format-tests
name: ruff-format-tests
entry: uv run ruff format --check
language: system
stages: [pre-commit]
types: [python]
files: ^tests/
groups: [local,github-tests]
- id: pylint-tests
name: pylint-tests
entry: uv run pylint
language: system
stages: [pre-commit]
types: [python]
files: ^tests/
groups: [local,github-tests]
# ── Docstring linters (tests/) ──────────────────────────────────────────────────
- repo: local
hooks:
- id: docstring-linter-tests
name: docstring-linter-tests
entry: uv run docstring-linter
language: system
stages: [pre-commit]
types: [python]
files: ^tests/
groups: [local,github-tests]
# ── Tests & qualite ──────────────────────────────────────────────────────────
- repo: local
hooks:
- id: pytest-coverage-all-files
name: pytest-coverage-all-files
entry: uv run pytest --cov --cov-branch --cov-report=term-missing -q --no-header
language: system
stages: [pre-commit]
pass_filenames: false
always_run: true
groups: [local,github-tests]
- id: vulture-all-files
name: vulture-all-files
entry: uv run vulture tests/ src/ .vulture
language: system
stages: [pre-commit]
pass_filenames: false
always_run: true
groups: [local,github-tests]