Skip to content

[reporting] Group unused skips by rule, skip reporting on narrowed runs#8069

Merged
TomasVotruba merged 3 commits into
mainfrom
tv-skip-7
Jun 20, 2026
Merged

[reporting] Group unused skips by rule, skip reporting on narrowed runs#8069
TomasVotruba merged 3 commits into
mainfrom
tv-skip-7

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Unused skip reporting: group by rule + avoid false positives

Follow-up to the unused-skip reporting feature.

Group unused paths by rule

Previously each unused rule-scoped skip was printed on its own line, repeating the rule class:

* Rector\...\ReturnTypeFromReturnDirectArrayRector => app/bundles/LeadBundle/Model/LeadModel.php
* Rector\...\ReturnTypeFromReturnDirectArrayRector => app/bundles/CoreBundle/Entity/TranslationEntity.php

Now multiple paths are grouped under their rule, matching the ->withSkip() config shape:

* Rector\...\ReturnTypeFromReturnDirectArrayRector => [ app/bundles/LeadBundle/Model/LeadModel.php
    app/bundles/CoreBundle/Entity/TranslationEntity.php ]

Single-path skips stay on one line as before.

Skip reporting on narrowed runs

A narrowed run only touches part of the codebase, so skips outside that scope look falsely unused and produce many false positives. Unused-skip reporting is now disabled when the run is narrowed via:

  • a CLI paths argument (e.g. bin/rector process app/bundles/PointBundle/Controller/TriggerController.php)
  • --only
  • --only-suffix

This applies to both console and JSON output (both go through UnusedSkipResolver).

@TomasVotruba TomasVotruba merged commit 3893ea4 into main Jun 20, 2026
67 checks passed
@TomasVotruba TomasVotruba deleted the tv-skip-7 branch June 20, 2026 22:55
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.

2 participants