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
skip_output:
- meta
- success
- summary
# most commands are run through 'uv run' to get a consistent version
# this costs ~10ms each
pre-commit:
parallel: true
commands:
rustfmt:
tags: formatter
# cargo assumed to be correct version, controlled via rustup
run: cargo +nightly fmt --check
taplo:
tags: formatter
glob: "*.toml"
# No need to --force-exclude for taplo
run: taplo format --check -- {staged_files}
env:
# without this, taplo is very verbose
RUST_LOG: warn
typos:
tags: spellcheck
run: typos --force-exclude --format=brief -- {staged_files}
cargo-rdme:
run: cargo rdme --check
glob:
- "src/lib.rs"
- "README.md"
# takes one parameter - the file with the proposed commit message
# access through lefthook with `{1}`
#
# If this hook fails, a backup of the commit message is saved in .git/
commit-msg:
commands:
typos-commit:
tags: spellcheck
run: typos -- {1}