Skip to content

[reporting] Add reportUnusedSkips() to report skips that never matched#8058

Merged
TomasVotruba merged 2 commits into
mainfrom
tv-skip-reports
Jun 20, 2026
Merged

[reporting] Add reportUnusedSkips() to report skips that never matched#8058
TomasVotruba merged 2 commits into
mainfrom
tv-skip-reports

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Jun 20, 2026

Copy link
Copy Markdown
Member

In case of long ->skip([]) method in rector.php config, users sometime need a quick way to verify what was fixed. So do we to check if bug is still there or not.

Similar to PHPStan feature, that reports unused skips: https://phpstan.org/user-guide/ignoring-errors#reporting-unused-ignores

Adds a ->reportUnusedSkips() config option, similar to PHPStan's
reportUnusedIgnores. Tracks which ->withSkip() elements actually matched
during a run via a shared UsedSkipCollector, then warns about path and
rule-with-path skips that never matched and can be removed.

Used skips are aggregated across parallel workers through the process
bridge and carried on ProcessResult. Skip-everywhere rule skips are
forgotten from the container at boot, so they are not trackable at
runtime and are excluded from the report.
@TomasVotruba TomasVotruba changed the title tv skip reports [reporting] Add reportUnusedSkips() to report skips that never matched Jun 20, 2026
@TomasVotruba TomasVotruba merged commit 3da7c72 into main Jun 20, 2026
66 checks passed
@TomasVotruba TomasVotruba deleted the tv-skip-reports branch June 20, 2026 11:01
@TomasVotruba

Copy link
Copy Markdown
Member Author

Let's test this in a wild 👌

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