[ax] Add validate-config command for config hygiene checks - #8450
Merged
Conversation
TomasVotruba
force-pushed
the
tv-validate-config
branch
from
September 3, 2026 22:01
384af18 to
7af05f0
Compare
TomasVotruba
enabled auto-merge (squash)
September 3, 2026 22:46
Fixes shared-process test isolation: other tests leak ROOT_STANDALONE_REGISTERED_RULES / SET_REGISTERED_RULES into the global param provider, which made getBothSetAndRulesDuplicatedRegistrations report a false issue. Claude-Session: https://claude.ai/code/session_01QDEtmow9psVbccgbgHDqgd
…andTest setUp Extend the clean baseline to every global param the hygiene reporters read, so no chunk order in the shared test process leaks a false issue into the JSON deprecated-rule count. Claude-Session: https://claude.ai/code/session_01QDEtmow9psVbccgbgHDqgd
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
Agents and CI need a way to check a
rector.phpfor hygiene problems without running a full refactor pass over the codebase. Until now these checks (deprecated rules, duplicate registrations, dead skips) only surfaced as warnings during a realprocessrun, mixed in with the actual work.What
New
validate-configcommand. It boots the config, runs the existing hygiene reporters without touching any files, and exits non-zero if anything is reported - so it can gate CI or an agent step.Checks (all reuse existing services, no new detection logic):
beforeTraversehookwithRules()Implementation
report*methods onDeprecatedRulesReporterand the two static checks onMissConfigurationReporternow return the number of issues reported (werevoid).ProcessCommandcalls them as before and ignores the return, so behavior there is unchanged.ValidateConfigCommandsums those counts plus the duplicate-registration and deprecated-skipped-class checks, and maps the total toSUCCESS/FAILURE.Tests
ValidateConfigCommandTest: deprecated registered rule ->FAILURE; clean config ->SUCCESS(isolated reporters, exit code asserted viaCommandTester).composer check-cs,composer phpstanclean; existingMissConfigurationReporterTeststill green; verified on the CLI.