Skip to content

[DX] Fix run on custom rector config when no rector.php and no rules/sets registered#7985

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-custom-rector-config
May 12, 2026
Merged

[DX] Fix run on custom rector config when no rector.php and no rules/sets registered#7985
TomasVotruba merged 1 commit into
mainfrom
fix-custom-rector-config

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik samsonasik commented May 12, 2026

Fixes rectorphp/rector#9757

When no rules/sets registered in custom rector config.

Before

  rector-src git:(main) ✗ bin/rector --config="custom-rector.php" --dry-run

 No "rector.php" config found. Should we generate it for you? [yes]:
 > no

After

bin/rector --config="custom-rector.php" --dry-run 
                                                                                                                        
 [WARNING] Register rules or sets in your "custom-rector.php" config     

Steps to reproduce:

  • no rector.php
  • create custom-rector.php without rule/sets registered
  • run rector with --config="custom-rector.php"

@samsonasik
Copy link
Copy Markdown
Member Author

Fixed 🎉 /cc @Art4

@samsonasik samsonasik changed the title [DX] Fix run on custom rector config when no rector.php [DX] Fix run on custom rector config when no rector.php and no rules/sets registered May 12, 2026
@samsonasik samsonasik requested a review from TomasVotruba May 12, 2026 03:53
@samsonasik
Copy link
Copy Markdown
Member Author

@TomasVotruba ready 👍

@TomasVotruba TomasVotruba merged commit c3518f3 into main May 12, 2026
76 checks passed
@TomasVotruba TomasVotruba deleted the fix-custom-rector-config branch May 12, 2026 05:19
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.

[DX] Invalid config file returns missleading error message

2 participants