diff --git a/hk.pkl b/hk.pkl index 501439c..d85ec8c 100644 --- a/hk.pkl +++ b/hk.pkl @@ -1,7 +1,7 @@ amends "package://github.com/jdx/hk/releases/download/v2.0.1/hk@2.0.1#/Config.pkl" import "package://github.com/jdx/hk/releases/download/v2.0.1/hk@2.0.1#/Builtins.pkl" -steps { +local linters = new Mapping { ["cargo-fmt"] = Builtins.cargo_fmt ["cargo-clippy"] = (Builtins.cargo_clippy) { check = new CommandSpec { @@ -14,3 +14,18 @@ steps { } } } + +hooks { + ["pre-commit"] { + fix = true + stash = "git" + steps = linters + } + ["fix"] { + fix = true + steps = linters + } + ["check"] { + steps = linters + } +}