WPBP / WordPress-Plugin-Boilerplate-Powered

Wordpress Plugin Boilerplate but Powered with examples and a generator!
https://wpbp.github.io/
GNU General Public License v3.0
782 stars 116 forks source link

[Feature] Change/Override particular CodeatCodingStandard(s) per project #227

Closed MikeiLL closed 1 year ago

MikeiLL commented 1 year ago

I want to sniff for php8 and up only. Do we document how to to override that Codeat Standards in a particular project?

Mte90 commented 1 year ago

For that you need to check the PHPCS documentation as it is to do with a ruleset.xml file

https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset

MikeiLL commented 1 year ago

So, the WPBP user would make their own ruleset file and point it towards the CodeatCoding one in. the vendor dir?

Mte90 commented 1 year ago

No you have to put it in the plugin root folder like with the other file of the same plugin. If you see https://github.com/codeatCode/codeatcs it is just a ruleset with various rules enabled or disabled.

MikeiLL commented 1 year ago

So you mean, just copy that ruleset and use it, as opposed to the one in the vendor dir?

Mte90 commented 1 year ago

Can be an option or you can extend COdeatCS in your ruleset with more as you can see in the phpcs documentation and the rule file you can do both. Instead to run that CS you will use your ruleset.xml file that will have what you want. CodeatCS is just a wrapper with 3 different CS with some rules disabled.