rectorphp / rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
https://getrector.com
MIT License
8.32k stars 670 forks source link

[DX] Add Get Rules Command / Rule multiple option #8605

Open dbpolito opened 1 month ago

dbpolito commented 1 month ago

Rector is such a great tool, it does so much great stuff that for big projects it's very challenging to run, and more important, review changes... so here is my 2 ideas that would improve DX drastically on big projects....

I know this probably can be achieved creating different config files, but bear with me 😄

Get Rules

Create a command like rector get-rule-list, which just returns a list of all rules, one per line...

Rule Multiple Option

Like add rector process --rule=a --rule=b, so we can force to just one or a few rules per time.

My idea / workflow is:

  1. play with config
  2. get the rules
  3. run one by one and commit separately

So it can be easier to review / evaluate...

Yay or Nay?

I would be open to make a PR for that, just want to confirm the idea is good or i didn't miss any existing feature.

TomasVotruba commented 2 weeks ago

Hey, I just got to your suggestions.

Are you still interested in making those? It would be great to have them separetelly in own PRs, to see the implementation and idea behing them :+1: