chore(pre-commit): validate the shared renovate presets - #2213
Open
cardoe wants to merge 1 commit into
Open
Conversation
The renovate-config-validator hook's default files pattern is (^|/).?renovate(?:rc)?(?:\.json5?)?$, which matches .github/renovate.json but not .github/renovate/*.json. The shared presets that this repo and undercloud-deploy both extend were therefore never validated locally -- the fileMatch rename in #2212 was skipped by the hook entirely. Extend the pattern to cover them. All seven presets pass as-is, and injecting an unknown option into one makes the hook fail as expected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cardoe
enabled auto-merge
August 12, 2026 15:12
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.
Why
The
renovate-config-validatorhook's defaultfilespattern is(^|/).?renovate(?:rc)?(?:\.json5?)?$. That matches.github/renovate.json, but not.github/renovate/*.json— so the shared presets that this repo andRSS-Engineering/undercloud-deployboth extend have never been validated locally.This was noticed concretely: the
fileMatch→managerFilePatternsrename in #2212 reportedrenovate-config-validator .... Skipped (no files to check). A typo in a preset would have shipped silently, and because both repos extend these presets unpinned (no#ref), a broken preset takes effect on the next Renovate run of either repo with no PR to catch it.Verification
Coverage — matching the new pattern against
git ls-files(both= already covered,NEW= newly covered):No other path in the repo is pulled in.
All seven presets pass as-is, so this does not land red:
prek run renovate-config-validator --all-files→Passed(exit 0), no warnings.The hook can actually fail — injecting an unknown option (
grupName) into.github/renovate/nautobot.jsongivesrenovate-config-validator ... Failed. An invalid regex inmatchStringsis caught too.One limit worth recording: the validator is lenient about some shapes —
matchPackageNamesgiven a bare string instead of an array validates fine, because Renovate coerces it. So this catches unknown options and malformed regexes, not every possible mistake.Note
Preset files are validated as global config (
INFO: Validating <file> as global config), since the hook passes filenames as arguments. That is fine for these files and is how the existingrenovate.jsoncheck already behaves.🤖 Generated with Claude Code