Repository navigation
fix(hook): document why the compiled-file skip gates tidy, pin hook parity - #336
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Refs #320
The premise of #320 was wrong: the compiled-file grep in the pre-commit hooks is not dead code.
adf tidyis indeed called without--source, soSTAGED_VENDORSnever narrows what tidy scans. But the whole tidy block is wrapped inif [ -n "$STAGED_VENDORS" ]. Removing compiled files fromSTAGED_VENDORSmeans a commit that stages only compiled output (the normaladf compile --writeflow) never runs tidy and never runsgit add .ai/*.adf. Without the grep, such a commit would run tidy over the whole tree and pick up unrelated.ai/*.adfedits that were never staged. A review reproduced exactly that against the built dist.This PR:
.githooks/pre-commitand in the hook text thatpackages/cli/src/commands/hook.tsgenerates. In both copies, the misleading comment is replaced with one that says what the grep actually does: it gates the whole tidy run. When tidy does run because a non-compiled vendor file is staged, tidy's own compiled-file skip (fix(adf): stop tidy ingesting compiled vendor output #319) handles compiled files.hook.test.ts:totalExtractedgrep..githooks/pre-commitline for line, so the two copies can't drift apart.Follow-up, not in this PR: option 2 from the issue. That means passing
--sourcefor each staged file and re-staging only the modules tidy changed. When a non-compiled vendor file is staged, the hook still runs tidy over the whole tree and re-stages all.ai/*.adf.Implemented via constellation-loop.
🤖 Generated with Claude Code