Skip to content

[scripts] Skip configurable rules in the unused-rules audit - #8236

Merged
TomasVotruba merged 1 commit into
mainfrom
filter-configurable-rules-from-unused-audit
Jul 30, 2026
Merged

[scripts] Skip configurable rules in the unused-rules audit#8236
TomasVotruba merged 1 commit into
mainfrom
filter-configurable-rules-from-unused-audit

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

scripts/list-unused-rules.php reported 60 rules as "not in any set". 23 of them are ConfigurableRectorInterface rules — they do nothing without their own configuration, so they can never be listed in a set on their own. They are false positives that bury the rules genuinely missing from a set.

Now they are filtered out and counted separately.

Before:

Found 57 Rector rules not in any set

After:

Found 34 Rector rules not in any set
Skipped 23 configurable Rector rules

The remaining 34 are the actionable ones — e.g. Rector\Symfony\Symfony73\Rector\Class_\InvokableCommandInputAttributeRector, Rector\PHPUnit\PHPUnit100\Rector\Class_\RemoveNamedArgsInDataProviderRector and Rector\PHPUnit\PHPUnit120\Rector\MethodCall\ExplicitMockExpectsCallRector, whose namespaces name the very set they are missing from.

Configurable rules do nothing without their own configuration, so they
can never be listed in a set. Reporting them as "not in any set" hides
the rules that are genuinely missing from a set.
@TomasVotruba
TomasVotruba enabled auto-merge (squash) July 30, 2026 21:54
@TomasVotruba
TomasVotruba merged commit ad881a1 into main Jul 30, 2026
65 checks passed
@TomasVotruba
TomasVotruba deleted the filter-configurable-rules-from-unused-audit branch July 30, 2026 21: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.

1 participant