Closed kyle-jennings closed 5 years ago
From WordPress, I do not like:
I'm up in the air about:
Might be easier to skip the WP ruleset and create a custom file.
https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/PSR2/ruleset.xml
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
Even if just the default psr2 rules, anyone using CodeSniffer should pick up that file to override any default rules they are using. Then you can add rules as you see fit.
Conversely, it's pretty easy to remove the WP rules you don't like, i.e. <exclude name="WordPress.VIP.AdminBarRemoval.RemovalDetected" />
@miklb I've decided just to go with the PSR standards. I'm slowly going through each file and formatting things as I add features and fix bugs.
Awesome. I'm about to revisit the project I've been working using your tools, so will see what/where I can contribute. Thanks for addressing this.
would this default ruleset work for you along with an .editorconfig
to normalize tabs & space?
I see latest commit addresses this with a phpcs.ruleset.xml
file. thanks 🎉
Finally getting around to this. After reflecting, I decided to use the WordPress code standards and have updated the phpcs ruleset to use the which include Core, Docs, and Extra as documented here: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
@miklb checkout this branch: https://github.com/kyle-jennings/benjamin/tree/wpcs
I need to double and triple check everything but I'm hoping to merge that into dev and master soon
@miklb brought up the importance of using the WP Coding standards, which in turn forced me to look at my code in horror and realize that I need to clean things up.
I don't really like the WP coding standards (gross for example, are Yoda conditions ), and would prefer to use the PHP PSR standards. We can use phpcs.ruleset.xml to override WP Coding Standards we don't like. Lets use this issue to determine what we do and dont like.