Zum Inhalt springen

Hk Updates & Release Notes

Einträge
45
Quellen
1
Zuletzt aktualisiert

Folge Hk, um die Release Notes in deinen Feed zu holen.

Hk von jdx

Hk 1.44.3: fail_on_fix und lesbare CI-Logs

Hk 1.44.3 sorgt dafür, dass fail_on_fix=true die Fixer-Ausgabe nicht mehr über das eigene git add staged, und macht die Text-Fortschrittsausgabe in CI-Logs wieder lesbar.

A small patch release fixing two notable rough edges: fail_on_fix=true no longer silently re-stages the fixer's output over your git add, and hk's text-mode progress output is finally readable in CI logs.

Fixed

  • fail_on_fix=true no longer overwrites your staged changes with the fix (@jdx) #892. Previously, when a hook had fail_on_fix = true, the step's auto-staging would silently merge the fixer's output into the index over your explicit git add choices. After the failed commit, the fix was no longer visible as an unstaged change for review, and a re-commit would silently succeed with the fix baked in — defeating the entire point of fail_on_fix. should_stage is now forced off for RunType::Fix runs when fail_on_fix is set, so the fixer's output stays in the worktree as an unstaged change for you to inspect, and the commit keeps failing until you accept it. Fixes #888.

  • Text-mode progress output is usable in CI again (@jdx) #890. hk's output in GitHub Actions and other piped-stderr environments was a mess: raw [9A[80D[0J cursor-control escapes leaked into the log, every status change was duplicated, failure stderr was suppressed, and a step matching hundreds of files dumped ~4KB of paths into every progress line. This release fixes the lot: …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

Hk 1.44.2: pklr-Cache und weniger Warnungen

Hk 1.44.2 behebt, dass Änderungen an hk.pkl unter HK_PKL_BACKEND=pklr den Cache nicht ungültig machten, und unterdrückt die pklr-Deprecation-Warnungen beim Laden von Builtins.pkl.

A small patch release focused on two HK_PKL_BACKEND=pklr rough edges: edits to hk.pkl are now picked up immediately, and loading Builtins.pkl no longer spams deprecation warnings on every run.

Fixed

  • hk.pkl edits are now picked up under HK_PKL_BACKEND=pklr (@jdx) #879. The two pkl backends return different things from analyze_imports — the pkl CLI happens to include the source file in resolvedImports, but pklr only returns transitive import URIs. As a result, with pklr the main hk.pkl was missing from the config cache's fresh_files, so edits didn't invalidate the cache and hk kept reusing the stale Config until you ran hk cache clear. The main config path is now always added to fresh_files. Fixes #877.

  • No more pklr deprecation warnings on every Builtins.pkl load (@jdx) #880. Previously, every invocation under HK_PKL_BACKEND=pklr printed:

    [pklr] WARNING: property 'check_byte_order_marker' is deprecated
    [pklr] WARNING: property 'fix_byte_order_marker' is deprecated
    ``` …
    

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

Hk 1.44.1: post-commit, pre-rebase und YADM-Worktrees

Hk 1.44.1 ergänzt eigene hk run-Subcommands für post-commit und pre-rebase und sorgt dafür, dass HK_STASH_UNTRACKED=false auch den Scan nach untracked Dateien überspringt, was YADM-artige Dotfile-Repos beschleunigt.

A small patch release fixing two rough edges introduced with the v1.44.0 global-hooks work: post-commit and pre-rebase now have proper hk run subcommands, and HK_STASH_UNTRACKED=false finally skips the untracked-file scan (not just the stash), which makes hk usable on YADM-style dotfile repos where GIT_WORK_TREE is $HOME.

Fixed

  • hk run post-commit and hk run pre-rebase are now first-class subcommands (@jdx) #858. Both events are written by hk install, but previously fell through to the generic other handler — so they didn't show up in hk run --help and their arguments got mixed into the positional file collector, occasionally producing confusing Usage: hk run --from-ref <FROM_REF> [FILES]... errors during git rebase. pre-rebase now has a typed <upstream> [branch] signature matching git's spec, and post-commit is a proper no-args handler. …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

Hk 1.44.0: Globale Installation und --plan

Hk 1.44.0 führt hk check --plan/--why/--json zum Trockenlauf von Hooks, hk install --global mit Git 2.54+, Unterstützung für GIT_DIR/GIT_WORK_TREE (z. B. YADM) und das Builtin cocogitto_commit_msg ein.

This release is all about understanding and controlling where hk runs. hk check --plan lets you dry-run a hook and see exactly which steps would execute and why, hk install --global registers hk against every repo on your machine using Git 2.54's new config-based hooks, and bare-repo dotfile managers like YADM are now supported via GIT_DIR/GIT_WORK_TREE.

Highlights

  • hk check --plan / --why / --json — dry-run any hook to see which steps would run, which would skip, and why, with JSON output for tooling
  • hk install --global — install hooks once in ~/.gitconfig and have hk apply to every repo (Git 2.54+)
  • Bare-repo dotfile support — hk now respects GIT_DIR and GIT_WORK_TREE, so YADM and similar setups work out of the box
  • New cocogitto_commit_msg builtin for Conventional Commits validation

Added

  • hk check --plan / -P, --why [STEP] / -W, --json / -J: You can now dry-run a hook to see what hk would do without executing any commands. --plan prints the parallel groups, matched file counts, and included/skipped steps with reasons; --why drills into the skip reasons for every step (or a specific one); --json emits the plan as structured JSON for tooling. (@jdx) #848

    $ hk check --plan
    Plan: check
    Run type: check
    
      [parallel group] group_0
        ○ actionlint  (no files matched filters)
        ✓ cargo-fmt  (6 files matched) …
    

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

Hk 1.43.0: hook_stdin, harper-Builtin und musl-Binaries

Hk 1.43.0 fügt die Template-Variable {{ hook_stdin }} für git-lfs, ein harper-cli-Builtin zur Grammatikprüfung und Linux-musl-Binaries hinzu, und hk ist wieder per cargo install hk über crates.io erhältlich.

This release adds {{ hook_stdin }} for forwarding git hook stdin to step commands (completing git-lfs support started in v1.42.0), introduces a built-in harper grammar checker, and ships Linux musl binaries for Alpine and other musl-based distributions.

Highlights

  • {{ hook_stdin }} template variable completes git-lfs pre-push support -- LFS objects are now properly uploaded during git push
  • harper-cli builtin adds grammar checking as a first-class linter
  • Linux musl release binaries for Alpine and other musl-based distros
  • hk is back on crates.io -- installable via cargo install hk again

Added

  • {{ hook_stdin }} template variable: Step commands can now receive the raw stdin that git passes to hook scripts via the stdin field. This is essential for git lfs pre-push, which needs the ref data piped through stdin to know which LFS objects to upload. Without this, git lfs pre-push would silently succeed but upload nothing, causing the remote to reject the push. The variable is available in pre-push and post-rewrite hooks. (@JohanLorenzo) #825

    hooks {
        ["pre-push"] {
            steps {
                ["git-lfs"] {
                    check = "git lfs pre-push {{ hook_args }}"
                    stdin = "{{ hook_stdin }}"
                }
            }
        }
    }
    ``` …
    

Originalquelle(öffnet in neuem Tab)Problem melden