Repository navigation
Declare the fixing pre-commit hook and skip hk-test in it - #2389
Merged
Merged
Conversation
The merge queue ran hk check, where dotnet format fails on every analyzer warning it has no code fix for (ZA0601, for one), even in lines a PR didn't touch. It now runs hk fix like the PR run does; autofix.ci still pushes the PR's fixes back, and steps with no fixer still fail. Locally, the pre-commit hook is now declared: it fixes, stages the fixes and stashes unstaged edits first. There's no pre-push hook. hk-test now clears GIT_DIR, GIT_WORK_TREE and GIT_INDEX_FILE before running hk test. Run from a worktree's pre-commit, the tests' scratch git commands reached the real repository, wrote core.worktree into the shared .git/config and raced each other for its lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
The merge queue's temporary branch can't take a push, so its lint run now skips the hk step instead of running hk fix. Pull requests keep running hk fix, with autofix.ci committing the fixes back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores lint.yml to main's version: the merge queue runs hk check again, and pull requests run hk fix with autofix.ci committing the fixes back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores the built-in hk-test step, so hk check, hk fix and CI run it as before, and turns it off only in pre-commit. Inside a git hook the GIT_DIR / GIT_WORK_TREE git exports point hk test's scratch repositories at the real one; not running it there avoids that without `env -u`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
david-driscoll
enabled auto-merge
November 14, 2026 20:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes only the local hooks in
.config/hk.pkl. CI's lint workflow is unchanged: pull requests runhk fixand autofix.ci commits the fixes back, and the merge queue runshk check.pre-commitis now declared explicitly. It fixes, stages the fixes, and stashes unstaged edits first, so a fixer only rewrites what's being committed.hk run pre-pushhook exits 0 without running anything.hk-test: it's skipped inpre-commit(step_condition = "false"on that hook's copy of the step). The top-level built-in step is unchanged, sohk check,hk fixand CI still run it.GIT_DIRandGIT_WORK_TREE, andhk test's scratchgit initandgit configran against the real repository instead.core.worktreeinto the shared.git/config, which points the main checkout at the wrong folder. The tests also raced each other for the config lock.Verified
hk run <hook> --plan: pre-commit shows○ hk-test (step_condition evaluated to false), while check and fix show✓ hk-test. All 16 steps are present in each..git/configstayed clean.hk check --from-ref origin/main --to-ref HEADpasses, includinghk-testand pkl-format.🤖 Generated with Claude Code