lmjtfy.git / hk.pkl
hk.pkl27 lines · 724 B · raw
1// Git hooks, run by hk (jdx/hk), installed with `mise run hooks:install`. The hk release below must be
2// the one in mise.toml (tools/check-versions.sh checks it).
3amends "package://github.com/jdx/hk/releases/download/v2.5.0/hk@2.5.0#/Config.pkl"
4
5local clippy = new Step {
6  glob = List("**/*.rs", "**/Cargo.toml", "Cargo.lock")
7  // Warnings are shown, not fatal: an error-level lint stops the commit.
8  check = "cargo clippy --workspace --all-targets"
9}
10
11local tests = new Step {
12  glob = List("**/*.rs", "**/Cargo.toml", "Cargo.lock")
13  check = "cargo test --workspace --lib"
14}
15
16hooks {
17  ["pre-commit"] {
18    steps {
19      ["clippy"] = clippy
20    }
21  }
22  ["pre-push"] {
23    steps {
24      ["tests"] = tests
25    }
26  }
27}