Skip to content

Commit c70ef15

Browse files
fix(hooks): let hk batch guard steps on Windows
shell = bash sized batches from ARG_MAX (128KB fallback on Windows), so a whole-repo run rendered one ~15KB command that Windows rejected with "The command line is too long." The guards are hk util subcommands and need no shell. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 59b2804 commit c70ef15

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

hk.pkl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ import "package://github.com/jdx/hk/releases/download/v1.53.0/hk@1.53.0#/Builtin
44

55
local bash: String = "bash -c"
66

7+
// No `shell` override: these builtins are `hk util` subcommands, so they need
8+
// no shell, and the structured form is what lets hk auto-batch `{{files}}`.
9+
// Under a shell hk sizes batches from ARG_MAX (128KB fallback on Windows), so
10+
// a whole-repo run renders one ~15KB command that Windows rejects with "The
11+
// command line is too long."
712
local sharedGuards = new Mapping<String, Step> {
8-
["check-merge-conflict"] = (Builtins.check_merge_conflict) { shell = bash }
9-
["detect-private-key"] = (Builtins.detect_private_key) { shell = bash }
13+
["check-merge-conflict"] = (Builtins.check_merge_conflict) {}
14+
["detect-private-key"] = (Builtins.detect_private_key) {}
1015
["check-added-large-files"] = (Builtins.check_added_large_files) {
11-
shell = bash
1216
exclude = List(
1317
"pnpm-lock.yaml",
1418
"src/typegen.d.ts",

0 commit comments

Comments
 (0)