-
Notifications
You must be signed in to change notification settings - Fork 6
fix: pre-commit runs zero hooks — restore the hooks, add a CI gate, apply Prettier #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| ignored: | ||
| - DL3018 # Alpine package version pinning breaks on minor bumps | ||
| - DL3018 # Alpine package version pinning breaks on minor bumps |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion —
exclude:on the next line duplicates a subset of.prettierignore: it carriespi-fork/,packages/k8s-sandbox/src/gen/andgen/, but notnode_modules/,dist/,*.logorpnpm-lock.yaml.Behavior is already correct today, because Prettier applies
.prettierignoreeven to paths passed explicitly on the command line — which this PR incidentally demonstrates:pnpm-lock.yamlis in.prettierignoreand came through the repo-wide reformat with only the+13/-0dependency addition, no reflow.So this is not a bug, just a second list that has to stay in agreement with the first. Since the stated goal here is that
make fmtand the hook "cannot disagree by construction", droppingexcludeentirely and letting.prettierignorebe the single source of truth would extend that same property to the ignore set. Non-blocking.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in e34b5e9 —
excludeis gone,.prettierignoreis now the only ignore list.Agreed on the reasoning, and I checked the mechanism rather than trusting it. Appending deliberately misformatted code to
packages/k8s-sandbox/src/gen/sandbox/v1/sandbox.tsand passing that path directly topnpm exec prettier --write --ignore-unknown:Two things that confirm it is safe beyond the happy path: the file is left alone even though it was named explicitly, and exit is 0 even though every path passed was ignored — so pre-commit batches consisting entirely of ignored files do not fail the hook.
Coverage-wise
.prettierignoreis a strict superset of whatexcludecarried, so nothing widens:pi-fork/,packages/k8s-sandbox/src/gen/andgen/are all in it, plus the four it was missing.make lintstill exits 0 with all nine hooks running, and no generated or submodule file is touched. I left a comment at the hook explaining why there is noexclude, so it does not get re-added later as an apparent oversight.