-
-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets #5477
Conversation
8ccf675
to
d4fb0a8
Compare
bc79127
to
9361d9d
Compare
Co-authored-by: Abdul Malik Ikhsan <[email protected]>
This "best practice" is silly. If I'm running rector in CI then I want it to prevent known deprecated code from being introduced. Changing from The only way to make sure this new already deprecated code gets fixed is to run periodic Not to mention you've removed not deprecated the I agree running for example Symfony 3.3 rules on Symfony 5.4 is silly, unnecessary and intensive. You're essentially running fixes for code which is impossible to have implemented. What we actually need is sets which include fixes for all deprecations in the current major versions (if the package follows semver that is). For example, |
I like this option 👍 |
If you're able to use glob patterns (or can enable it to be allowed) then you could set it up so the constant is pointed to all the sets in that version - for example, Worth mentioning an edge case might be someone running Symfony 6.1 when Symfony 6.2 is available with rectors. The rectors may add code which won't function. However, I'd expect in most cases people will be upgrading to the latest minor version at the same time as when they upgrade rector. Regardless such a feature is useful for running older versions like Symfony 5.4. |
rector-src/src/Config/RectorConfig.php Lines 227 to 231 in f03a6fd
so if that needed, the collection of explicit paths need to be registered |
It's not best practise to use
UP_TO_*
sets inrector.php
longer than is their single-run. They run dozens of rules with very complex logic, as it take to get from Symfony 2 to 7. It's like running a Tesla control and checking all elements available since the first horse ride :)Also, the tools we build upon - php-parser and PHPStan - traverse tree from top to bottom. That means if Symfony 4.4 changes a class, and then Symfony 3.4 changed a method, the changes would crash with each other.
We published post about this, but we should do more to have a DX that is useful and practical:
https://getrector.com/blog/5-common-mistakes-in-rector-config-and-how-to-avoid-them
The best practice - and we use it this way since the first Symfony rule set - to run those just once and remove 👍
Instead use only the latest major sets, to keep up to date and get fast and reliable Rector run 🚀
Thank you