Repository navigation
[Reporting] Keep needed skip when two skipped rules would make the same change - #9072
Merged
Merged
Conversation
…es make the same change
…cannot make the same change first
TomasVotruba
force-pushed
the
tv-repro-9979-shared-skip
branch
from
November 27, 2026 11:34
5943814 to
16de11c
Compare
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.
Fixes rectorphp/rector#9979
RemoveDeadInstanceOfRectorandRemoveAlwaysTrueIfConditionRectorare both skipped on the same file, and each one alone changes it.NeededSkipVerifierre-ran the file once with all skips off, so the first rule made the change and the second found nothing left. Its skip was then reported as unnecessary, but removing it changed the file.Now each skipped rule is verified on its own: the file is re-run with only that rule's skip lifted, while other skips keep applying. This matches what happens when the user removes that one skip.
Skipper::startVerifyingSkip(string $rectorClass)replaces the all-off flagNeededSkipVerifierre-runs per rule + file pair (dry run only, reporting phase)