Skip to content

Update dependency hk to v1.37.0#116

Merged
vertti merged 1 commit intomainfrom
renovate/hk-1.x
Mar 4, 2026
Merged

Update dependency hk to v1.37.0#116
vertti merged 1 commit intomainfrom
renovate/hk-1.x

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 3, 2026

This PR contains the following updates:

Package Update Change
hk minor 1.36.01.37.0

Release Notes

jdx/hk (hk)

v1.37.0: : Smarter Config, Hook-Level Env, and Better Fix/Check Semantics

Compare Source

This release overhauls global configuration handling, adds hook-level environment variables, and fixes several correctness issues in check/fix workflows.

Highlights

Overhauled global config (hkrc) -- The global user configuration has been significantly reworked. hk now supports the full Config.pkl format in hkrc files (not just UserConfig.pkl), fixing a panic when using the documented example with hooks and steps. The recommended config location is now ~/.config/hk/config.pkl, with clear "project wins" merge semantics. The legacy .hkrc.pkl paths and --hkrc flag are deprecated and will be removed in v2. Thanks @​ivy! #​710

Hook-level env support -- Hooks can now define environment variables that are automatically passed to all their steps, reducing duplication when multiple steps need the same variables. Step-level env takes precedence over hook-level env. #​709

check_diff correctness in check mode -- Previously, steps with check_diff defined would always run the diff command first, even in check mode. This could hide non-auto-fixable errors when the diff command exited 0. The diff-first shortcut is now gated to fix mode only. Thanks @​nkakouros! #​717

Added

  • Hook-level env: Define environment variables once per hook instead of repeating them on every step. Step-level env takes precedence when both define the same variable. (@​jdx) #​709

    hooks {
        ["pre-push"] {
            env {
                ["HK_PROFILES"] = "types"
            }
            steps = linters
        }
    }
  • Go-style diff parsing: hk now correctly handles unified diffs where the --- line has a .orig suffix (common with Go tools like gofmt -d). (@​jdx, co-authored by @​thejcannon) #​704

  • XDG config directory support: Global configuration can now be placed at ~/.config/hk/config.pkl (or a custom path via HK_CONFIG_DIR). (@​ivy) #​710

  • Config precedence documentation: A clear precedence table and hkrc merge semantics are now documented, covering built-in defaults through CLI flags. (@​ivy) #​701 #​710

Fixed

  • end-of-file-fixer now enforces that files end with exactly one trailing newline, matching pre-commit-hooks behavior. Previously it would add a missing newline but leave multiple trailing newlines untouched. (@​jdx) #​708

  • pre-commit with stash no longer passes untracked files to linters as input. Untracked files were incorrectly included in the unstaged files set, causing them to be processed during hk run pre-commit. Thanks @​nkakouros! #​716

  • check_diff in check mode no longer silently swallows errors. When a step defines check_diff, hk previously ran the diff command first in all modes. If the diff command exited 0 (no auto-fixable issues), non-auto-fixable violations detected by the regular check command were hidden. The diff-first shortcut is now only used in fix mode. Thanks @​nkakouros! #​717

  • hkrc format support: Global config files can now use the full Config.pkl format with hooks containing steps that have check, fix, and glob fields. Previously this caused a panic because hk always deserialized hkrc as UserConfig. (@​ivy) #​710

  • hkrc discovery path: Default hkrc discovery now correctly checks ~/.hkrc.pkl and ~/.config/hk/config.pkl, instead of only looking for .hkrc.pkl relative to the current directory. (@​ivy) #​710

  • --all flag documentation now correctly describes what the flag does. Thanks @​nkakouros! #​715

Deprecated

  • .hkrc.pkl and --hkrc flag are deprecated and will be removed in hk v2. Use ~/.config/hk/config.pkl for global configuration or hk.local.pkl in the project root for per-project overrides. Deprecation warnings are shown when legacy paths are used. #​710

New Contributors

Full Changelog: jdx/hk@v1.36.0...v1.37.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Mar 3, 2026
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.24%. Comparing base (dc0cc2e) to head (f2837c9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #116   +/-   ##
=======================================
  Coverage   93.24%   93.24%           
=======================================
  Files          49       49           
  Lines        1837     1837           
=======================================
  Hits         1713     1713           
  Misses         88       88           
  Partials       36       36           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@renovate renovate bot force-pushed the renovate/hk-1.x branch from dc7d003 to f2837c9 Compare March 4, 2026 07:56
@vertti vertti merged commit f7293da into main Mar 4, 2026
18 checks passed
@vertti vertti deleted the renovate/hk-1.x branch March 4, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant