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
# Local git hooks, managed by prek (https://github.com/j178/prek) - a fast, Rust,
# no-Python reimplementation of pre-commit. Enable once with: prek install
#
# Mirrors CI where it's cheap: typos + Conventional Commits on commit, rustfmt on the
# staged Rust files, and clippy on push (too heavy per commit). Rust hooks only fire when
# Rust files change (types: [rust]).
default_install_hook_types:
repos:
- repo: https://github.com/crate-ci/typos
rev: v1.49.0
hooks:
- id: typos
stages:
- repo: https://github.com/crate-ci/committed
rev: v1.1.11
hooks:
# Per-commit: lint the message as it is written.
- id: committed
stages:
# Pre-push: lint every commit about to be pushed (mirrors CI's range check),
# so a subject that slipped past commit-msg (an --amend, a --no-verify) is
# caught before it reaches CI. Reuses the same managed committed binary.
- id: committed
alias: committed-range
name: committed (whole push range)
stages:
always_run: true
pass_filenames: false
args:
- repo: local
hooks:
- id: rustfmt
name: rustfmt
entry: rustfmt --edition 2024
language: system
types:
stages:
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy --all-targets --all-features --locked -- -D warnings
language: system
types:
pass_filenames: false
stages: