hk now ships with the built-in pklr evaluator as the default config backend — no pkl CLI required — plus three stash, merge-base, and Windows batching fixes that close out reported regressions, and a handful of builtin improvements from @hituzi-no-sippo.
Added
-
pklris now the default pkl backend (@jdx) #976.hk.pklis evaluated with the embedded pklr interpreter out of the box, so the ApplepklCLI is no longer required to use hk. The CLI backend is still available viaHK_PKL_BACKEND=pkl; unrecognized values now warn and fall through topklr. The config cache also switched from mtime comparisons to hashing file contents, so edits to imported.pklfiles reliably invalidate the cache.# Default (no setup required) hk check # Opt back into the pkl CLI HK_PKL_BACKEND=pkl hk check
-
rylbuiltin gainsfixandcheck_list_files(@hituzi-no-sippo) #967. Bumps the underlyingrylto v0.13.0 and wires in the new commands. The yamllint config dependency is dropped. -
ryl_markdownbuiltin (@hituzi-no-sippo) #968. Lints YAML embedded inside Markdown documents using ryl's markdown support. -
hk_testbuiltin (@hituzi-no-sippo) #973. Runshk test --quietwhenever your hk configuration file changes so step-defined inline tests catch regressions automatically. -
hk sponsorscommand (@jdx) #961. A small no-config subcommand that prints the projects and companies sponsoring hk and the en.dev project family. Works withouthk.pkl.
Fixed
-
Last-line edits of partially-staged files no longer get corrupted on restore (@ad1269) #966. The "pure tail insertion" special case in the manual stash restore had a newline-tolerant fallback that stripped the index snapshot's trailing newline before the prefix check, so a last-line edit like
l3: tail→l3: tail UNSTAGEDwas misclassified as a tail insertion and re-emitted asfixer content + " UNSTAGED\n". The fallback now only accepts an empty remainder (the original case from #304); real last-line edits fall through to the three-way merge, which handles them correctly. The recovery patch written under the state dir also restores the trailing newline thatcmd.read()strips, sogit apply --checkno longer fails withcorrupt patch at line N. Fixes #965. -
hk checkworks when there is no merge base (@jdx) #975.files_between_refspreviously bailed when libgit2 or git couldn't find a common ancestor (e.g. shallow clones or unrelated histories). It now falls back to a shellgit merge-base, then to a directfrom..totree/shell diff. Both the libgit2 and shell-git paths use the same range logic, covered by new bats tests withHK_LIBGIT2=1andHK_LIBGIT2=0. Refs #972. -
Auto-batching respects the
cmd.execommand-line limit (@jdx) #974.auto_batch_jobsnow selects a shell-specific safe length: 4095 bytes (half of Windows' ~8191-character cap) forcmd.exe, andARG_MAX / 2for everything else. Medium-sized{{files}}expansions that fit under UnixARG_MAXno longer blow past thecmdlimit unbatched. Fixes #971. -
git2updated to 0.21 (#956).
Documentation
Full Changelog: v1.46.0...v1.47.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.