-
Notifications
You must be signed in to change notification settings - Fork 2
Home
This is an evolving PHP CodeSniffer configuration meant to enforce our code standards.
Currently, this is just enforcing some of our code style rules, but in the future can and should be expanded to enforce all style rules and some other implementation guidelines.
In the future, we could also choose to import some of the WordPress or WooCommerce CodeSniffer configurations.
- Any sniffs we want to add to every project should be added to
ruleset.xml
- Any sniffs we want to add only to certain projects should be added to the file of the same in that project's repo.
This is the main configuration file for CodeSniffer. Sniffs are referenced with the <rule>
entity and correspond to a namespaced rule. Here are some lists/directories that contain CodeSniffer rules we can implement here (some may need to be imported in composer.json
before they can be referenced):
Eventually we may come to find that we need a sniff that doesn't exist anywhere else. In that case, we may want to develop our own. Here's the tutorial on how to do that.
- Check the instructions on the project repo, but generally this should be installed using composer and can be run by executing
./vendor/bin/phpcs