Allow rule configuration to aid adoption #350
Unanswered
jradtilbrook
asked this question in
Q&A
Replies: 2 comments
-
eg. could i check a list or regex etc at this line? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This didn't seem too difficult so I've submitted a PR #351 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, I'm wondering if you'd either accept a PR or help me with a fork of this to convert the Laravel 8 factory rectors to a configurable version so that I can introduce them in parts?
The scenario:
Working with a legacy codebase dating back to Laravel 5.6 and with many other frameworks in the mix (yii, twig, slim, etc). We are converging on Laravel for everything and being able to update our old closure based factories in one step.
However, running just that single rector set to convert them over results in breakages (I think we are doing some weird things with closures ¯_(ツ)_/¯). As a result, I'd prefer if I could apply some sort of filter to the rector so it only converts a subset of factories at a time.
I believe there are 200+ factories.
I don't think it would be "safe" to try adjusting the
withPaths
config to just the items we want in case we miss some necessary files. And I don't believe each rule works together does it? Each rule works solo to convert its found tokens.So I think what I'd like to do, is implement https://getrector.com/documentation/configured-rules on the 3 rules so they can accept a list of classes or a regex or something to match on and only convert those over. Then can run the rule set gradually.
I'm new to rector so does that make sense and sound possible. Any tips for how to actually implement that?
Beta Was this translation helpful? Give feedback.
All reactions