amends "package://github.com/jdx/hk/releases/download/v1.49.0/hk@1.49.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.49.0/hk@1.49.0#/Builtins.pkl"
local linters = new Mapping<String, Step> {
["actionlint"] = Builtins.actionlint
["cargo-fmt"] = (Builtins.cargo_fmt) {
workspace_indicator = "rust-toolchain.toml"
check = "cargo fmt --check --all"
fix = "cargo fmt --all"
}
["cargo-check"] = (Builtins.cargo_check) {
workspace_indicator = "rust-toolchain.toml"
check = "cargo check --all-targets --all-features --locked"
}
["cargo-clippy"] = (Builtins.cargo_clippy) {
workspace_indicator = "rust-toolchain.toml"
check = "cargo clippy --all-targets --all-features --locked -- -D warnings"
fix =
"cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged --locked -- -D warnings"
}
// uses taplo for TOML formatting and validation
["taplo"] {
glob = List("**/*.toml")
check = "taplo fmt --check {{files}} && taplo check {{files}}"
fix = "taplo fmt {{files}} && taplo check {{files}}"
}
["actionlint"] {
glob = List(".github/workflows/*.yml")
check =
"SHELLCHECK_OPTS='--exclude=SC1090 --exclude=SC2046 --exclude=SC2086 --exclude=SC2129' actionlint"
}
["rumdl"] {
glob = List("**/*.{md,mdx}")
exclude = List("**/__snapshots__/**")
fix = "uv tool run rumdl==0.2.34 fmt {{files}}"
}
["hk-validate"] {
glob = List("hk.pkl")
check = "hk validate"
}
["pkl-format"] = (Builtins.pkl_format) {}
}
hooks {
["pre-commit"] {
fix = true
stash = "git"
steps = linters
}
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
}