Skip to content

[Configuration] Skip deprecated rules from active set, warn only instead of crashing - #8358

Merged
TomasVotruba merged 2 commits into
mainfrom
fix-deprecated-rules-exit-code
Aug 22, 2026
Merged

[Configuration] Skip deprecated rules from active set, warn only instead of crashing#8358
TomasVotruba merged 2 commits into
mainfrom
fix-deprecated-rules-exit-code

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Aug 21, 2026

Copy link
Copy Markdown
Member

Fixes rectorphp/rector#9859

A registered deprecated rule crashed Rector with exit code 1 instead of only warning.

DeprecatedRulesReporter printed the deprecation as a warning, but the rule was still registered and run. Every deprecated rule has a gutted refactor() that throws, so as soon as it matched a node the run crashed.

Fix: ConfigurationRuleFilter now drops deprecated rules from the active set. They still warn, but never run.

Before: warning + [ERROR] -> exit code 1
After: warning only -> exit code 0

@TomasVotruba
TomasVotruba force-pushed the fix-deprecated-rules-exit-code branch from 6852d14 to f951c9a Compare August 22, 2026 11:01
@TomasVotruba
TomasVotruba enabled auto-merge (squash) August 22, 2026 11:01
@TomasVotruba
TomasVotruba merged commit a9c7644 into main Aug 22, 2026
50 of 51 checks passed
@TomasVotruba
TomasVotruba deleted the fix-deprecated-rules-exit-code branch August 22, 2026 11:02
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.

Deprecations break rector

1 participant