Skip to content

[Reporting] Add failing test for needed skip reported as unnecessary when two skipped rules make the same change - #9072

Open
TomasVotruba wants to merge 1 commit into
mainfrom
tv-repro-9979-shared-skip
Open

TomasVotruba wants to merge 1 commit into
mainfrom
tv-repro-9979-shared-skip

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Reproducer for rectorphp/rector#9979

RemoveDeadInstanceOfRector and RemoveAlwaysTrueIfConditionRector are both skipped on the same file, and each one alone changes it. NeededSkipVerifier re-runs the file with the full ruleset, so the first rule makes the change and the second finds nothing left. Its skip is then reported as unnecessary, but removing it changes the file.

The test expects no unnecessary skips and fails now:

+    0 => 'Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector: ...shape.php',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant