From 27c535d370f45ffb22f60bc55bd3a38c0d75dbee Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 3 Oct 2026 08:27:50 +0000 Subject: [PATCH] chore: add hk pre-commit hook Co-Authored-By: Claude Sonnet 5.5 --- hk.pkl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 + } +}