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
# Pre-commit hygiene + Rust quality gate for target-match.
# Install with: pre-commit install -t pre-commit -t pre-push
minimum_pre_commit_version: "3.5.0"
# Hygiene + Rust checks run at commit time; only the secret scan runs on push.
default_stages:
# Never reformat vendored / generated agentic tooling or the SpecKit scaffold —
# those files are managed by APM / spec-kit, not by this repo's style rules.
exclude: '^(\.claude/|\.agents/|\.codex/|\.specify/|apm_modules/)'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args:
- id: mixed-line-ending
args:
# Rust format + lint, run through the project toolchain (rust files only).
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt --
language: system
types:
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy --all-targets --all-features -- -D warnings
language: system
types:
pass_filenames: false
# Secret scan on push (defense in depth for a publishable crate).
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.2
hooks:
- id: gitleaks
stages: