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
Introduce PHP CS to improve code quality #16755
Conversation
I've added another commit that adds a short open tag (should be removed before merge). The check fails now because of it. The error is also directly highlighted in the changed files tab. |
sure could start with just this and see over time if/when we run into issues that could have been detected through this and then add it when needed (or when we notice something as part of a review we could think whether we can automatically detect certain thing in the future). Generally not so much coding style as it's not as important but probably more like |
Disallowing some methods like |
Not needed for now. Be good to keep it simple. |
5dd04f7
to
b9b1b4b
Compare
@tsteur @diosmosis can we merge this one? Might be helpful to have some basic checks and being able to add new checks if something pops up in the future that would have been detectable with phpcs... |
👍 |
Description:
In order to improve our code quality a bit, it would imho be awesome by stating to introduce automatic PHPCS checks.
I've started with a very basic ruleset, that only disallows the usage of short open tags and forces using \n as line endings.
There is also a new workflow, that will automatically run for Pull Requests, so it can be directly seen if a PR breaks any coding rules.
If that PR get's merged I would add some other rules step by step and directly provide fixes for code that doesn't comply. Maybe anyone else also has some suggestions for rules we should use.
Review