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

v2.15.0: hk: config imports, CI annotations, per-hook jobs, and nine new builtins

hk 2.15.0 lets hk.pkl import hk's own modules through hk: URIs, so configs no longer need a version bump on every upgrade. hk check can now report findings as GitHub Actions annotations and GitLab Code Quality reports, and hooks can set their own jobs and hide_when_done. Each run writes per-step output files for agents and CI, and hk init --mise installs the detected linters. This release adds builtins for C#, C/C++, Clojure, Kotlin, Snakemake, API specs, reStructuredText, Python security and GitHub's Actions lockfile. It also fixes pre-push runs that update several refs, index locking during read-only runs, and Windows batching through pnpm exec/npx.

Added

  • hk: module URIs (#1912). Configs can import the modules of the hk that evaluates them, so you no longer bump a versioned package:// URL on each upgrade. hk serves these modules from its own binary, so they work offline and never download anything. hk init, hk migrate pre-commit, the examples and the docs now generate this form:

    amends "hk:/Config.pkl"
    import "hk:/Builtins.pkl"
    ``` …
    

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.14.0: Secret scanning across pushed commits, recheck_after_fix, and new builtins

hk 2.14.0 lets secret scanners check every commit in a push. It adds an opt-in recheck_after_fix setting so a check runs again when a later fixer changes its files, and it adds the bun_fmt, keep_sorted, cspell, cspell_commit_message and hk_validate builtins. It also fixes bugs in stash handling, --mise launchers and stdin formatters.

Added

  • Scan every pushed commit for secrets (#1880, @jdx). Before, a scanner on pre-push only checked the final state of the files. A credential added in one commit and removed in a later one passed, even though the push still sent the first commit. gitleaks, betterleaks, trufflehog and kingfisher now accept scan = "commits", which scans each commit in the run's ref range (pre-push, --from-ref or --pr):

    hooks {
        ["pre-push"] {
            steps {
                ["gitleaks"] = (Builtins.gitleaks) { scan = "commits" }
            }
        }
    }
    

    The default scan for each builtin is unchanged. This change also adds a requires_ref_range step field. When a step sets it and the run has no ref range, the step fails with an error such as gitleaks: needs a ref range (pre-push, --from-ref, or --pr) instead of scanning nothing and passing. Step tests can now set from_ref and to_ref. …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.13.0: Opt-in step result caching and ref range access for steps

hk 2.13.0 adds two step features. With cache = true, a check that already passed is skipped when its input files haven't changed. Steps can also read the --from-ref/--to-ref range. This release also fixes terraform_validate/tofu_validate on Windows and Python detection for uv run --script scripts.

Added

  • Skip checks that already passed on the same file contents (#1835, @jdx). Set cache = true on a step. If its check exited 0 before and the same check runs again on the same file contents, hk skips the command and shows "passed before, unchanged". This helps when pre-commit reruns checks that hk check just passed. If a step reads more than the files it was given, such as a workspace-wide build or cargo clippy, list those inputs in cache_inputs. Those globs replace the job's file list in the cache key:

    ["clippy"] {
        glob = "*.rs"
        check = "cargo clippy --workspace -- -D warnings"
        cache = true
        cache_inputs = List("**/*.rs", "**/Cargo.toml", "Cargo.lock", "mise.toml")
    }
    

    The cache key includes:

    • the hk version and step name
    • the rendered command
    • the working directory
    • the step's env, shell and stdin
    • the contents of each input file …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.12.0: Restrict conventional commit scopes

hk 2.12.0 lets the check_conventional_commit builtin restrict which scopes a commit can use. It also fixes three bugs: misleading errors when a run is stopped by SIGTERM or SIGHUP, missing hooks after hk install --legacy on top of a global install, and stash restore failures caused by another linked worktree.

Added

  • Allowed scopes for conventional commits (#1817, @jonahsnider). Set allowed_scopes on check_conventional_commit to limit which scopes commit messages can use:

    ["conventional-commit"] = (Builtins.check_conventional_commit) {
      allowed_scopes = List("web", "api")
    }
    

    Commits without a scope are always accepted. A commit with any other scope is rejected, and the error lists the allowed scopes. If you omit allowed_scopes, any scope is accepted. To accept only commits without a scope, set allowed_scopes = List(). Each list entry must hold one scope, with no commas. The same option is available directly as hk util check-conventional-commit --allowed-scopes web,api.

Fixed …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.11.1: Fix stash restore under git --literal-pathspecs

hk 2.11.1 fixes pre-commit hooks that failed to restore stashed files when git ran with --literal-pathspecs (or GIT_LITERAL_PATHSPECS=1).

Fixed

  • Stash restore under GIT_LITERAL_PATHSPECS (#1796, @jdx). Running git --literal-pathspecs commit sets GIT_LITERAL_PATHSPECS=1 for every child process, including hooks. Some tools pass this flag on every git call. Under that variable, git read hk's :(literal)PATH pathspecs as part of the file name. As a result, hk couldn't restore a stashed untracked file or git add fixed files, and the commit failed with errors like:

    git error: pathspec ':(literal)src/affected/cargo.rs' did not match any file(s) known to git
    hk ERROR pre-commit: hook finished with error: failed to restore stash
    

    hk's own git commands now run with GIT_LITERAL_PATHSPECS, GIT_GLOB_PATHSPECS, GIT_NOGLOB_PATHSPECS and GIT_ICASE_PATHSPECS set to 0, so git reads its pathspecs as hk wrote them. Steps still get the environment the caller set. Plain git commit was not affected.

Full Changelog: https://github.com/jdx/hk/compare/v2.11.0...v2.11.1

💚 Sponsor hk

hk is built and maintained by @jdx, an open source developer at entire.io, the title sponsor of his open source work. …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.11.0: Structured diagnostics from clippy, ruff, eslint, tsc, shellcheck and more builtins

In hk 2.11.0, many more builtins report structured diagnostics (file, line, column, rule and message), so --sarif, JSON output and the MCP dashboard now show them. It also fixes pre-commit checks that ran while a file deleted from the worktree was still staged in the index.

Added

  • Diagnostics for more builtins (#1791, @jdx). Before this release, hk check --sarif, the diagnostics arrays in --format json/jsonl and the MCP dashboard were empty for many popular builtins. You got a failed step and a block of raw text. hk now parses the output these tools print by default, without changing any builtin's command:

    diagnostic_format builtins
    rustc cargo_clippy, cargo_check, ruff (0.12+), ty
    rustfmt rustfmt, cargo_fmt (diff hunks reported as warnings)
    stylish eslint, stylelint
    tsc tsc, tsserver
    shellcheck shellcheck
    pyright pyright
    biome biome
    gcc-paren golangci_lint, staticcheck
    $ hk check --all --format json | jq -c '.steps[].diagnostics[]'
    {"step":"cargo_clippy","tool":"cargo_clippy","severity":"warning","message":"length comparison to zero","path":"src/main.rs","range":{"start":{"line":4,"column":8}},"rule":"clippy::len_zero","help_url":"https://rust-lang.github.io/rust-clippy/beta/index.html#len_zero"}
    ``` …
    

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.10.0: Hook timeouts and six new builtins

hk 2.10.0 adds a hook-level timeout that fails a hook when it runs too long. It also adds six builtins: trufflehog, osv-scanner, pyright, phpstan, protolint and dotenv-linter.

Added

  • Hook timeout (#1776, @jdx). Set timeout on a hook to cap how long it can run in total. The limit covers all of the hook's steps, including time spent waiting for the stash lock. When the time runs out, hk stops the running steps the way Ctrl-C does, restores any stashed changes, and fails the hook with pre-commit: timed out after 10s, so the commit or push is blocked.

    hooks {
      ["pre-commit"] {
        fix = true
        timeout = "10s"
        steps = linters
      }
    }
    

    A value is a number followed by a unit (ms, s, m or h). You can combine units, as in "1m30s". hk rejects a bare number, zero or an unknown unit when it loads the config. If you don't set timeout, a hook runs until its steps finish, as before. The setting applies only to whole hooks: there is no per-step or global timeout. As with other hook-level settings, hk ignores it in subproject configs.

  • New builtins (all by @illesnagy1):

    • trufflehog (#1774) scans text files for secrets. It runs offline with --no-verification, so it does not contact providers to check whether a credential it finds is live. Add a trufflehog:ignore comment to suppress a finding. …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.8.2: Resolve check file arguments from the current directory

hk 2.8.2 makes hk check <file> resolve paths from the directory you run it in, and stops hk processes that start at the same time from reading half-written config cache files. cargo install hk builds now include the Pkl package, so offline mode works with them, and hk install --global reports the git config file it actually wrote to.

Fixed

  • File arguments are resolved from the directory hk was run in (#1754, @jdx). hk changes to the repository root before it runs, so relative file arguments used to be resolved from the root. Running hk check a.js inside sub/ checked <root>/a.js instead of sub/a.js. Paths given as arguments or through --files0-from are now resolved from where you ran hk. Absolute paths and paths outside the repository still work. Fixes #1753.

    $ cd sub
    $ hk check a.js      # checks sub/a.js (previously <root>/a.js)
    $ hk check ../a.js   # checks a.js at the repository root
    $ hk check .         # checks sub/
    ``` …
    

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.9.0: OpenTofu validation builtin and shfmt formatting for zsh startup files

hk 2.9.0 adds a tofu_validate builtin for OpenTofu, and the shfmt builtin now formats zsh startup files and scripts that have a zsh shebang. It is also the first release since 2.7 that installs with cargo install hk, because the 2.8.2 crate was never published.

Added

  • tofu_validate builtin (#1766, @illesnagy1). This builtin runs tofu validate once in each directory that contains changed *.tf, *.tfvars, *.tf.json, *.tofu, *.tofu.json or .terraform.lock.hcl files. It skips anything under .terraform/. If validation fails on a module that hasn't been initialized, it runs tofu init -backend=false -input=false and validates again. The builtin is a POSIX shell script, so on Windows you need to set shell to a POSIX shell.

    hooks {
      ["pre-commit"] {
        steps {
          ["tofu_validate"] = Builtins.tofu_validate
        }
      }
    }
    ``` …
    

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.8.1: Stash entries no longer shared across linked worktrees

hk 2.8.1 stops pre-commit hooks in different linked worktrees from taking each other's stash entries, and lets those hooks run in parallel. It also removes a deprecation warning printed by the ryl_markdown builtin.

Fixed

  • Stashing is now separate for each linked worktree (#1747, @jdx). With stash = "git", hk used to put its entry on refs/stash, and every linked worktree shares that stack. A git stash pop, drop or push in one worktree could take hk's entry while a hook was running in another worktree. The hook then failed with "hk's stash entry … is no longer in the stash list", and its unstaged and untracked changes were left in a stash that the other worktree could pop. hk now keeps its entry under a private ref, refs/hk/stash/<commit-id>, which git stash never reads or writes. hk-stash.lock now lives in each worktree's own git directory, so hooks in different worktrees run in parallel. Two hk processes in the same worktree still take turns. Entries that older hk versions pushed onto git stash can still be restored or dropped. Fixes #1746.

    git stash list no longer shows hk's entries. To inspect or recover one, use its commit id:

    git for-each-ref refs/hk/stash
    git stash show -p <commit-id>
    git stash apply <commit-id>
    git update-ref -d refs/hk/stash/<commit-id>
    ``` …
    

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.8.0: YAML formatting with ryl and a builtin for global mise config repositories

hk 2.8.0 adds builtins that format YAML with ryl format and a builtin for repositories that hold a global mise config. It also stops commit signing from breaking hk test, and updates the bundled TLS certificate crates after the eMudhra CA compromise.

Added

  • ryl_format and ryl_markdown_format builtins (#1737, @jdx). Builtins.ryl_format formats YAML files. Builtins.ryl_markdown_format formats YAML front matter and fenced yaml/yml blocks in Markdown files. check runs ryl format --check, check_diff runs ryl format --diff, and fix runs ryl format. Set formatting options in the [format] table of .ryl.toml. These builtins need ryl 0.25 or later. The existing ryl and ryl_markdown linters work as before.

    ["ryl_format"] = Builtins.ryl_format
    ["ryl_markdown_format"] = Builtins.ryl_markdown_format
    
  • mise_config_dir builtin (#1733, @jdx). This opt-in builtin formats a repository checked out at ~/.config/mise, for example one set up with mise bootstrap --adopt. It matches config.toml, config.*.toml, conf.d/*.toml, conf.d/*/mise.toml and conf.d/*/mise.*.toml. Each file goes through mise fmt --stdin, so files outside the repository are never touched. Builtins.mise is unchanged, which means repositories that use config.toml for other tools aren't affected. fix uses sh, so on Windows it needs a POSIX shell.

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.7.1: Global pre-commit hook keeps partial commits intact

hk 2.7.1 fixes the global pre-commit hook adding unstaged changes to commits. It also fixes spurious failures in the Vite+, oxfmt and standard_rb builtins, and makes hk init write a valid identifier for editorconfig-checker.

Fixed

  • Global pre-commit hook now stashes unstaged changes (#1715, @jdx). The hook installed by hk install --global runs hk run pre-commit --from-hook --staged. Because --staged always turned stashing off, the hook ignored its stash setting, including the default stash = "git". If you staged part of a file with git add -p and a fixer then changed that file, the unstaged hunks ended up in the commit. When --staged is used together with --from-hook, hk now follows the hook's stash setting. HK_STASH is ignored in that case, so a global HK_STASH can't override a repository's stash = "none". Running hk run pre-commit --staged yourself still doesn't stash.
  • vp_check, vp_fmt and vp_lint pass when no files match (#1716, @jdx). These Vite+ builtins now pass --no-error-on-unmatched-pattern, as the oxfmt builtin already does. Steps no longer fail when the Vite+ config ignores every staged file, and you don't need custom check/fix overrides for this. …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

v2.7.0: profile_condition for steps, new builtins, and per-repository logs and backups

hk 2.7.0 lets steps run based on and/or/not combinations of profiles, adds builtins for Herb, ansible-lint and Packer, and gives hk validate JSON output and a strict mode for CI. Logs, failure output and stash backups now live in each repository's git directory instead of one directory shared by every repository.

Added

  • profile_condition for steps (#1684, @jdx). profiles only runs a step when every listed profile is enabled. profile_condition takes an expression, so you can write rules like "run when ci or slow is enabled". The new profile(name) function is true when a profile is enabled and not turned off with --profile !name. You can also use profile() in condition expressions.

    ["prettier"] = (Builtins.prettier) {
      profile_condition = "profile(ci) or (profile(slow) and not profile(fast))"
    }
    

    profile_condition applies on top of profiles, so existing configs work as before. Skipped steps report which profiles could enable them. If the expression is invalid, hk logs a warning and skips the step. …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

hk 2.6.0: Typst- und jactionlint-Builtins, mehr Shebang-Dateitypen

hk 2.6.0 fügt Builtins für Typst und jactionlint hinzu, erkennt weitere Skripttypen anhand ihres Shebangs und beendet erfolgreiche Läufe mit einer Erfolgszeile, wenn Schrittausgaben angezeigt werden.

hk 2.6.0 adds builtins for Typst and jactionlint, detects more script types from their shebang, and ends passing runs with a success line when step output is shown. The agent stop hook no longer blocks in projects that don't use hk.

Added

  • Typst builtins (#1646, @jdx). Builtins.typstyle formats .typ files and Builtins.tinymist lints them. hk init detects both in Typst projects. In fix mode, hk applies the diff that typstyle prints. tinymist needs version 0.14.20 or newer. It checks each file separately, and the step still fails if an earlier file fails even when later files pass.

    hooks {
      ["pre-commit"] {
        fix = true
        steps {
          ["typstyle"] = Builtins.typstyle
          ["tinymist"] = Builtins.tinymist
        }
      }
    }
    
  • jactionlint builtin (#1663, @jdx). Builtins.jactionlint lints .github/workflows/*.yml and *.yaml with jdx/jactionlint, a maintained fork of actionlint. Its findings appear in hk check --sarif. The actionlint builtin is unchanged. …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

hk 2.5.0: Sichereres Stashing und deutlich schnelleres Laden der Konfiguration

hk 2.5.0 macht das Stashing bei Abbrüchen und parallelen hk-Prozessen sicher, lädt Konfigurationen deutlich schneller (kalt von etwa 1,4 s auf 0,07 s), meldet Diagnostics von mehr Builtins und behebt viele Fälle, in denen Prüfungen fälschlich bestanden wurden, sowie mehrere Windows-Probleme.

hk 2.5.0 makes stashing safe when hk is killed and when several hk processes run at once, loads configs much faster, and reports diagnostics from many more builtins. It also fixes a long list of cases where a check passed without checking anything, along with several Windows problems.

Highlights

  • Stashing holds up under interruption and concurrency. SIGTERM, SIGHUP and crashes no longer leave your unstaged changes stuck in git stash. Hooks running in linked worktrees now take turns stashing. Several edge cases that dropped or mixed up changes are fixed.
  • Configs load faster. A cold config load drops from about 1.4 s to about 0.07 s, and hk validate is about 14x faster. Several per-step and stashing costs are lower in large repos.
  • Fewer checks pass when they should fail. hk validate now catches more config mistakes. Several builtins and hk util checks no longer skip binary files, case conflicts in directory names, or executable bits recorded in git.

Added …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

hk 2.4.0: Mehr Builtins wenden Fixes als Patches an

In hk 2.4.0 wenden mehr Builtins bei hk fix ihren check_diff-Patch direkt an, und die neuen Utils hk util format-diff und hk util sarif-diff erzeugen Patches aus Formattern bzw. SARIF-Fixes.

In hk fix, many more builtins now apply their check_diff patch instead of running the tool a second time as the fixer. hk now applies those patches itself instead of calling git apply, and read-only check_diff commands can run in parallel with other steps that read the same files.

Added

  • hk util format-diff (#1514, @jdx). Builds an applicable patch from any formatter that reads stdin and writes the formatted file to stdout. It runs the formatter once per file, in parallel, and replaces {} with the file's path. It exits 1 with a patch when a file would change, and 0 when nothing would. If the formatter fails for any file or prints nothing for a non-empty file, it prints no patch, so hk runs fix and that reports the error. Use --no-stdin for formatters that read the file from its path.

    check_diff = "hk util format-diff {{files}} -- stylua --stdin-filepath {} -"
    
  • hk util sarif-diff (#1515, @jdx). Runs a tool that reports fixes in a SARIF log and turns them into a patch. It prints a patch only when every result has a usable fix. If any result has no fix, or the tool fails, it prints no patch and hk runs fix. The findings exit code defaults to 1 and can be changed with --findings-exit-code.

    check_diff = "hk util sarif-diff -- pinact run --check --format sarif {{files}}"
    ``` …
    

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

hk 2.3.1: Schnellerer Hook-Start und sichereres Stashing

hk 2.3.1 startet schneller, verteilt --jobs gleichmäßiger auf gebündelte Steps, führt die neue Step-Einstellung apply_check_diff ein und behebt Fälle, in denen Stashing Dateien verlieren oder fehlschlagen konnte.

hk now starts faster, spends less of its own time per file, and spreads --jobs more evenly across batched steps. This release also fixes several cases where stashing could lose files, fail before any step ran, or leave untracked files visible to steps.

Added

  • apply_check_diff step setting (#1495, @jdx). Defaults to true. If you set it to false, hk fix runs the step's fix command instead of applying the check_diff output, and hk check still shows the diff. In staging hooks such as pre-commit, hk still runs check_diff first and passes fix only the files the diff names. The trailing_whitespace and newlines builtins now use it. Together with a parallel file scan in hk util trailing-whitespace and hk util end-of-file-fixer, this roughly halves the time of those two steps on a whole-repo fix.

    ["my-fixer"] {
      check_diff = "my-fixer --diff {{files}}"
      fix = "my-fixer --write {{files}}"
      apply_check_diff = false
    }
    

Changed …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

hk 2.3.0: Schnelleres Staging, bessere Fix-Läufe, batch_min_files

hk 2.3.0 stagt in Staging-Hooks wie pre-commit die Dateien jedes Fixers sofort nach dessen Abschluss, nutzt --jobs bei hk fix --all besser, ergänzt die Step-Einstellung batch_min_files und behebt Fehler bei jq/yq-Builtins, Stashing vor dem ersten Commit und einen sporadischen Git-Absturz.

Staging hooks such as pre-commit now stage each fixer's files as soon as that fixer finishes, and hk fix --all makes better use of --jobs. This release also adds a batch_min_files step setting and fixes the jq/yq builtins, stashing before the first commit, and an intermittent git crash during concurrent staging.

Added

  • batch_min_files for batched steps (#1475, @jdx). Steps with batch = true can set the minimum number of files hk passes to one process. The default is still 4. Raising it means fewer processes, which helps tools with slow startup, such as prettier and eslint, on whole-tree runs. In hk's benchmark, batch_min_files = 200 on prettier and eslint cut hk check --all from 1.56 s to 1.33 s. It made a small pre-commit a little slower, so the builtins' defaults are unchanged. OS command-length limits can still split a batch below this number.

    steps {
      ["prettier"] = (Builtins.prettier) {
        batch_min_files = 200
      }
    }
    

Changed …

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

hk 2.2.0: Schnelleres Fixing, JUnit-XML-Berichte, neues migrate

hk 2.2.0 führt Fix-Steps standardmäßig direkt aus und macht hk run pre-commit dadurch etwa ein Drittel schneller, ergänzt JUnit-XML-Ausgabe mit --junit-xml, Git-Hook-Argumente in Bedingungen und ein überarbeitetes hk migrate pre-commit und behebt eine Staging-Race-Condition sowie einen veralteten Config-Cache.

Fix steps now run their fixer directly instead of checking first, and batch steps start fewer processes on small commits. Together these make hk run pre-commit about a third faster on a typical fixture. This release also adds JUnit XML output, hook arguments in conditions, and a hk migrate pre-commit that produces a working config right away. It fixes a staging race between concurrent fixers and a stale config cache when Pkl reads environment variables.

Added

  • --junit-xml <PATH> for hk check, hk fix and hk run <hook> (#1432, @sanga). Writes one JUnit <testcase> per step, with its status, duration and captured output, so CI systems such as Jenkins can show hk results. It works alongside --sarif, whatever output format you choose. If a run fails before any step is planned, the report still contains a failing test case, so it doesn't look like a passing build.

  • Git hook arguments in condition and step_condition (#1445, @jdx). Conditions can now use the hook variables that command templates already had: prev_head, new_head and is_branch_checkout (post-checkout), commit_msg_file (commit-msg, prepare-commit-msg), source and sha (prepare-commit-msg), hook_stdin (pre-push, post-rewrite), and hook_args (all hooks). Conditions are expr-lang expressions, so write is_branch_checkout, not {{ is_branch_checkout }}.

    hooks { …
    

Originalquelle(öffnet in neuem Tab)Problem melden

Hk von jdx

Hk 2.2.0: Schnelleres Fixing, JUnit-XML-Reports und überarbeitetes hk migrate pre-commit

Fix-Schritte führen ihren Fixer nun direkt aus und Batch-Schritte starten bei kleinen Commits weniger Prozesse, wodurch hk run pre-commit etwa ein Drittel schneller läuft; zudem gibt es --junit-xml <PATH>, Hook-Argumente in condition und step_condition, ein hk migrate pre-commit, das sofort eine funktionierende Konfiguration erzeugt, sowie Fixes für eine Staging-Race-Condition zwischen parallelen Fixern und einen veralteten Config-Cache bei Pkl-Umgebungsvariablen.

Fix steps now run their fixer directly instead of checking first, and batch steps start fewer processes on small commits. Together these make hk run pre-commit about a third faster on a typical fixture. This release also adds JUnit XML output, hook arguments in conditions, and a hk migrate pre-commit that produces a working config right away. It fixes a staging race between concurrent fixers and a stale config cache when Pkl reads environment variables.

Added

  • --junit-xml <PATH> for hk check, hk fix and hk run <hook> (#1432, @sanga). Writes one JUnit <testcase> per step, with its status, duration and captured output, so CI systems such as Jenkins can show hk results. It works alongside --sarif, whatever output format you choose. If a run fails before any step is planned, the report still contains a failing test case, so it doesn't look like a passing build.

  • Git hook arguments in condition and step_condition (#1445, @jdx). Conditions can now use the hook variables that command templates already had: prev_head, new_head and is_branch_checkout (post-checkout), commit_msg_file (commit-msg, prepare-commit-msg), source and sha (prepare-commit-msg), hook_stdin (pre-push, post-rewrite), and hook_args (all hooks). Conditions are expr-lang expressions, so write is_branch_checkout, not {{ is_branch_checkout }}.

    hooks { …
    

Originalquelle(öffnet in neuem Tab)Problem melden