-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
351 lines (318 loc) · 11.3 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
351 lines (318 loc) · 11.3 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# Pre-commit configuration
# Install: pre-commit install
# Run all: pre-commit run --all-files
# Update: pre-commit autoupdate
#
# Config files: .github/pre-commit/
# Cache directories: .data/cache/
# Fail fast on first error
fail_fast: false
# Default stages
default_stages: [pre-commit]
repos:
# =============================================================================
# General Checks (pre-commit/pre-commit-hooks)
# =============================================================================
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
name: "file-size: prevent large files"
args: ["--maxkb=50000"] # 50MB limit (GitHub max is 100MB)
- id: trailing-whitespace
name: "whitespace: trailing"
exclude: '\.md$'
- id: end-of-file-fixer
name: "whitespace: end-of-file"
- id: check-merge-conflict
name: "git: check merge conflicts"
- id: check-case-conflict
name: "git: check case conflicts"
- id: detect-private-key
name: "security: detect private keys"
exclude: |
(?x)^(
content/\.content/legacy/.*|
content/skills/.*/references/.*|
content/skills/.*/examples/.*
)$
- id: check-symlinks
name: "filesystem: check symlinks"
- id: check-executables-have-shebangs
name: "bash: check shebangs"
exclude: 'content/\.content/legacy/.*'
- id: check-json
name: "json: check syntax"
exclude: |
(?x)^(
content/plugins/.*/\..*\.json$|
content/plugins/.*/hooks/hooks\.json$|
content/\.content/.*|
\.zed/.*
)$
- id: check-yaml
name: "yaml: check syntax"
args: ["--unsafe"] # Allow custom tags
exclude: 'content/\.content/legacy/.*'
# =============================================================================
# Markdown Linting (rumdl)
# =============================================================================
- repo: https://github.com/rvben/rumdl-pre-commit
rev: v0.1.11
hooks:
- id: rumdl
name: "markdown: rumdl check"
args:
- "--config=.github/pre-commit/rumdl.toml"
exclude: |
(?x)^(
content/\.content/.*|
content/skills/.*/examples/.*|
content/skills/.*/references/.*
)$
# =============================================================================
# Link Checking (lychee)
# =============================================================================
- repo: https://github.com/lycheeverse/lychee
rev: lychee-v0.18.0
hooks:
- id: lychee
name: "links: lychee check"
args:
- "--config=.github/pre-commit/lychee.toml"
types: [markdown]
exclude: |
(?x)^(
content/\.content/.*|
content/skills/.*/examples/.*|
content/skills/.*/references/.*
)$
# =============================================================================
# YAML Linting (yamllint)
# =============================================================================
- repo: https://github.com/adrienverge/yamllint
rev: v1.38.0
hooks:
- id: yamllint
name: "yaml: yamllint validate"
args:
- "--config-file=.github/pre-commit/yamllint.yaml"
# =============================================================================
# JSON Linting - Local (explicit validation beyond check-json)
# =============================================================================
- repo: local
hooks:
- id: json-validate
name: "json: validate syntax"
entry: bash -c 'for f in "$@"; do python3 -c "import json; json.load(open(\"$f\"))" || exit 1; done'
language: system
types: [json]
# =============================================================================
# Spell Checking (cspell) - Local, uses config with multiple dictionaries
# =============================================================================
- repo: local
hooks:
- id: cspell
name: "spelling: cspell check"
entry: cspell lint --config .github/pre-commit/cspell.json --no-progress --no-summary
language: system
types: [text]
exclude: |
(?x)^(
.*\.sql$|
.*\.lock$|
.*\.tex$|
.*\.min\..*|
package-lock\.json$|
uv\.lock$|
content/\.content/.*|
content/skills/.*/examples/.*|
content/skills/.*/references/.*|
content/skills/.*/assets/.*|
content/skills/convert-.*|
content/skills/analysis\.md$|
content/rules/arustydev/schemas\.md$|
settings/mcp/.*|
settings/claude/.*|
content/skills/pkgmgr-homebrew-formula-dev/.*|
content/skills/external\.yaml$|
assets/templates/.*|
content/plugins/homebrew-dev/skills/.*
)$
# =============================================================================
# Claude Context Linting (cclint SDK) - Local, requires cli/bin/agents.ts
# =============================================================================
- repo: local
hooks:
- id: cclint
name: "cclint: validate claude context files"
entry: bash -c 'bun run cli/bin/agents.ts plugin lint --quiet 2>&1 | tail -10'
language: system
files: |
(?x)^(
content/agents/.*\.md|
content/commands/.*\.md|
\.claude/agents/.*\.md|
\.claude/commands/.*\.md
)$
pass_filenames: false
# =============================================================================
# Plugin Config Validation - Local, requires cli/bin/agents.ts
# =============================================================================
- repo: local
hooks:
- id: plugin-validate
name: "plugins: validate configs"
entry: bash -c 'bun run cli/bin/agents.ts plugin validate-all --quiet 2>&1 | tail -10'
language: system
files: |
(?x)^(
content/plugins/.*plugin\.json|
content/plugins/.*/\.lsp\.json|
content/plugins/.*/\.mcp\.json|
\.claude-plugin/marketplace\.json
)$
pass_filenames: false
# =============================================================================
# SQL Linting (sqlfluff)
# =============================================================================
- repo: https://github.com/sqlfluff/sqlfluff
rev: 4.0.0
hooks:
- id: sqlfluff-lint
name: "sql: sqlfluff lint"
args:
- "--config=.github/pre-commit/sqlfluff.cfg"
- id: sqlfluff-fix
name: "sql: sqlfluff fix"
args:
- "--config=.github/pre-commit/sqlfluff.cfg"
- "--force"
stages: [manual]
# =============================================================================
# Bash Linting (shellcheck)
# =============================================================================
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
name: "bash: shellcheck lint"
args:
- "--severity=warning"
- "--shell=bash"
# =============================================================================
# Bash Formatting (shfmt)
# =============================================================================
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.10.0-1
hooks:
- id: shfmt
name: "bash: shfmt check"
args:
- "-d" # Diff mode (check only)
- "-i=2" # 2 space indent
- "-ci" # Indent switch cases
- id: shfmt
name: "bash: shfmt fix"
args:
- "-w" # Write in place
- "-i=2"
- "-ci"
stages: [manual]
# =============================================================================
# Bash Security (shellharden)
# =============================================================================
- repo: https://github.com/aRustyDev/shellharden
rev: v0.1.0
hooks:
- id: shellharden
name: "bash: shellharden check"
# =============================================================================
# Brewfile Linting - Local, project-specific
# =============================================================================
- repo: local
hooks:
- id: brewfile-lint
name: "brewfile: syntax check"
entry: bash -c 'ruby -c brewfile >/dev/null'
language: system
files: "^brewfile$"
pass_filenames: false
# =============================================================================
# Justfile Linting - Local, project-specific
# =============================================================================
- repo: local
hooks:
- id: justfile-check
name: "justfile: syntax check"
entry: just --fmt --check --unstable
language: system
files: "^justfile$"
pass_filenames: false
- id: justfile-format
name: "justfile: format"
entry: just --fmt --unstable
language: system
files: "^justfile$"
pass_filenames: false
stages: [manual]
# =============================================================================
# Python Linting (ruff)
# =============================================================================
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
hooks:
- id: ruff
name: "python: ruff check"
args:
- "--config=.github/pre-commit/ruff.toml"
- "--fix"
- "--exit-non-zero-on-fix"
- id: ruff-format
name: "python: ruff format check"
args:
- "--config=.github/pre-commit/ruff.toml"
- "--check"
- id: ruff-format
name: "python: ruff format fix"
args:
- "--config=.github/pre-commit/ruff.toml"
stages: [manual]
# =============================================================================
# JavaScript/TypeScript Linting (biome)
# =============================================================================
- repo: https://github.com/biomejs/pre-commit
rev: v0.6.1
hooks:
- id: biome-check
name: "js/ts: biome check"
additional_dependencies: ["@biomejs/biome@2.0.0"]
args:
- "--config-path=.github/pre-commit/biome.json"
exclude: |
(?x)^(
node_modules/|
dist/|
build/|
.*\.min\..*|
content/\.content/.*|
content/skills/.*/examples/.*|
content/skills/.*/references/.*
)$
- id: biome-format
name: "js/ts: biome format"
additional_dependencies: ["@biomejs/biome@2.0.0"]
args:
- "--config-path=.github/pre-commit/biome.json"
- "--write"
exclude: |
(?x)^(
node_modules/|
dist/|
build/|
.*\.min\..*|
content/\.content/.*|
content/skills/.*/examples/.*|
content/skills/.*/references/.*
)$
stages: [manual]