This repository was archived by the owner on Oct 27, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
93 lines (82 loc) · 2.45 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
93 lines (82 loc) · 2.45 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
# Pre-commit hooks for Grafeo
# Install: cargo install prek && prek install
# (installs the pre-commit and commit-msg hooks listed in default_install_hook_types)
# Run manually: prek run --all-files
# Docs: https://github.com/j178/prek
default_install_hook_types: [pre-commit, commit-msg]
default_stages: [pre-commit]
repos:
# Built-in prek hooks
- repo: builtin
hooks:
- id: trailing-whitespace
exclude: '\.md$'
- id: end-of-file-fixer
exclude: '\.md$'
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args: ['--maxkb=1000']
# Typo checker
- repo: https://github.com/crate-ci/typos
rev: v1.50.3
hooks:
- id: typos
# Local Rust hooks
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt --all --
language: system
types: [rust]
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy --all-targets --all-features -- -D warnings
language: system
types: [rust]
pass_filenames: false
- id: cargo-deny
name: cargo deny
entry: cargo deny check
language: system
files: ^Cargo\.(toml|lock)$
pass_filenames: false
# Coverage check - manual only (too slow for every commit)
# Run with: prek run cargo-llvm-cov
- id: cargo-llvm-cov
name: cargo llvm-cov
entry: cargo llvm-cov --all-features --workspace --fail-under-lines 70
language: system
types: [rust]
pass_filenames: false
stages: [manual]
# Python hooks
- repo: local
hooks:
- id: ruff-check
name: ruff check
entry: ruff check --fix
language: system
types: [python]
- id: ruff-format
name: ruff format
entry: ruff format
language: system
types: [python]
# Repository policy (scripts/check_policy.py): rules on staged lines, and a commit
# message check that rejects AI co-author and "Generated with" lines
- repo: local
hooks:
- id: policy-diff
name: policy (staged lines)
entry: python scripts/check_policy.py diff --staged
language: system
pass_filenames: false
- id: policy-commit-msg
name: policy (commit message)
entry: python scripts/check_policy.py commit-msg
language: system
stages: [commit-msg]