A small feature release: Bazel users get first-class buildifier built-ins, and hk's auto-batching is now smart enough to leave steps alone when their commands don't actually reference the file list.
Added
-
buildifier_formatandbuildifier_lintbuilt-ins (@plx) #896. Two new built-ins for Bazel projects, modeled onbuf_format/buf_lint. They coverBUILD,BUILD.bazel,WORKSPACE,WORKSPACE.bazel,MODULE.bazel,*.bzl,*.star, and*.skyfiles, and ship with the usual project-indicator metadata so they're auto-suggested for Bazel repos.import "package://github.com/jdx/hk/releases/download/v1.45.0/hk@1.45.0#/Builtins.pkl" hooks { ["pre-commit"] { steps = new { ["buildifier-format"] = Builtins.buildifier_format ["buildifier-lint"] = Builtins.buildifier_lint } } }
Fixed
-
Auto-batching no longer splits jobs whose command doesn't reference
{{files}}(@jdx) #901. Previously, hk decided whether to split a step into multipleARG_MAX-safe batches purely from the size of the file-list expansion. On Windows — whereARG_MAXfalls back to 128KB — a step like:local vscodeCommitHint = new Step { exclusive = true check = "echo If you see this message in a pop-up, the pre-commit steps failed." }
…against a ~20K-file repo would be fanned out into ~29 jobs, printing the message 29 times even though the command never used
{{files}}. Auto-batching now happens at execution time with the full tera context available, renders the real run command for each candidate batch, and only splits when the rendered command exceeds the safe limit. Byte estimation is kept as a fallback if rendering fails. The split path also now correctly preservescheck_firstandworkspace_indicatoracross batches (the old code dropped them with a TODO).
Documentation
New Contributors
Full Changelog: v1.44.3...v1.45.0
💚 Sponsor hk
hk is developed by @jdx at en.dev — a small independent studio behind developer tools like mise, aube, hk, and more. Work on hk is funded by sponsorships.
If hk has sped up your pre-commit loop or made linting feel less painful, please consider sponsoring at en.dev. Sponsorships are what keep hk moving and the project independent.