fix(scripts): suppress false 'pre-commit hooks updated' in update-project.sh summary#74
Merged
Merged
Conversation
…edits the config `just update-hooks` (pre-commit autoupdate --freeze) exits 0 even when every hook is already at its latest frozen SHA, so update_precommit_hooks always added ".pre-commit-config.yaml: Updated hooks…" to the summary and set CHANGES_MADE — a false positive on an up-to-date repo. Gate it on `git diff --quiet -- .pre-commit-config.yaml` so the change is only reported when the file truly changed; otherwise print "already up to date". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Small accuracy fix surfaced by running
update-project.shon an up-to-datemain.just update-hooks(pre-commit autoupdate --freeze) exits 0 even when every hook is already at its latest frozen SHA.update_precommit_hookstreated any success as a change — always appending.pre-commit-config.yaml: Updated hooks…to the summary and settingCHANGES_MADE— so a no-op run reported a phantom change.Now it gates on
git diff --quiet -- .pre-commit-config.yaml: only reports/records the change when autoupdate actually rewrote the file, else prints "Pre-commit hooks already up to date".Verified: on current
mainthe script now prints "already up to date", the summary shows no file changes, andgit statusis clean (no phantom.pre-commit-config.yamlentry). shellcheck + shfmt clean.🤖 Generated with Claude Code