-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
chore: switch to mago #501
Conversation
563246f
to
0712fc0
Compare
84a0994
to
a5404f1
Compare
@veewee the ci failure seems to be unrelated to this change, can you confirm? I have also updated psalm so that might be the reason. |
I horizontally scrolled through the code-style changes and am OK with them. That said, I don't know if all rules we applied in php-cs-fixer and phpcs are configured the same way as in mago.
The CI didn't fail before, so it must be the bump of the psalm dependency in here. |
Yes, but it seems that php-cs-fixer and phpcs both were not able to actually apply some of those rules, for example, line soft limit rule in phpcs was never applied by phpcs, it only complained if a line exceeded that limit, while mago does split the line if is too long, and inlines it if it fits, an example can be seen in src/Psl/Async/sleep.php, where mago inlines the call because it fits into a single line, while both phpcs and php-cs-fixer ignore it. since phpcs and php-cs-fixer are not able to split lines or inline them correctly, we previously had to set a super high line limit in phpcs to avoid having to fix the lines manually. i personally think mago is doing a better job at applying psr-12 than both php-cs-fixer and phpcs. |
I'm sure mago is doing a good job regarding the rules it knows. My remark was more about the rules that are not in PSR-12. An non exhaustive list of examples:
(It's basically the reason why we've choosen to use both php-cs-fixer and phpcs : to force multiple rules that the other tool does not know) |
well, that's the goal of dogfeeding :D to improve it by using it on a real world project. as for the rule you listed.
I'll make sure to add all the missing rules you mentioned in the next couple of days before merging this. |
php-cs-fixer has https://cs.symfony.com/doc/rules/class_notation/final_class.html
php-cs-fixer uses https://cs.symfony.com/doc/rules/class_notation/ordered_interfaces.html
As mentioned, it is a non exhaustive list. If we want to fully remove both phpcs and php-cs-fixer, we should cover all the rules that we currently apply in both of those tools or agree on not using specific rules anymore. |
we had this disabled because we couldn't make it work in Psl sadly.
this is easy to add, but not sure if we want to.
I don't see the need for us to do that, as long as the code is psr-12 compatiable, which is what we had set those two tools to do. other rules can be implemented one-by-one, and that is the goal of having mago here, to act as an example+test case. |
Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
9f3da59
to
70b9b86
Compare
Signed-off-by: azjezz <azjezz@protonmail.com>
there is over 700 linting issues reported by mago, we will not be fixing those in this PR, but i will make a following PR to address them.