Repository navigation
chore: remove shadowed .lefthook.yml - #116
Merged
Merged
Conversation
The repo carried two lefthook configs, .lefthook.yml (Apr 1) and lefthook.yml (Apr 17), each defining a pre-commit fmt command with different settings. Nothing in the repo said which one ran, so a maintainer editing .lefthook.yml would be editing a file lefthook never reads. lefthook 2.1.10 loads lefthook.yml and ignores .lefthook.yml when both are present. Verified two ways: 'lefthook dump' in this repo returned lefthook.yml's content exactly (glob '*.rs', stage_fixed, a pre-push block, and none of .lefthook.yml's glob_matcher or pre-commit clippy), and a scratch repo with both files and distinguishing markers resolved to the undotted one. Neither run merged the two. Removing the shadowed file changes no hook behavior: 'lefthook dump' returns identical output before and after. The removed file's pre-commit clippy is not lost; lefthook.yml runs clippy at pre-push. Its 'export PATH=$HOME/.cargo/bin' prepend was a hand-rolled fix for ambient tool resolution, which aae-orc-evcp covers properly. Refs: aae-orc-9nfg
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.
forestage carried two lefthook configs,
.lefthook.yml(Apr 1) andlefthook.yml(Apr 17), each defining a pre-commit fmt command withdifferent settings. Nothing in the repo said which one lefthook reads, so
anyone tightening the pre-commit hook had even odds of editing a file
that never runs.
lefthook 2.1.10 loads
lefthook.ymland ignores.lefthook.ymlwhenboth exist. Verified two ways:
lefthook dumpin this repo returnslefthook.yml's content exactly:glob: '*.rs',stage_fixed: true, apre-pushblock, and none of.lefthook.yml'sglob_matcher: doublestaror its pre-commit clippy.to the undotted one; removing it flipped the result to the dotted one,
confirming precedence rather than coincidence.
Neither run merged the two.
Removing the shadowed file changes no hook behavior:
lefthook dumpreturns identical output before and after the deletion, and nothing in
the repo references
.lefthook.ymlby name. The pre-push hook (clippyplus the full test suite) ran clean on this branch.
Nothing is lost. The removed file's pre-commit clippy already runs at
pre-push in
lefthook.yml. Itsexport PATH="$HOME/.cargo/bin:$PATH"prepend was a hand-rolled workaround for ambient tool resolution, which
aae-orc-evcp addresses properly. That prepend also turns out to have been
load-bearing: pushing this branch failed with
cargo: command not founduntil the push was run under
mise x rust@1.97.1, so the pre-push hookin
lefthook.ymlhas the same gap and no workaround.Refs: aae-orc-9nfg