woocommerce / woocommerce-sniffs
WooCommerce sniffs
Installs: 4 980 915
Dependents: 32
Suggesters: 0
Security: 0
Stars: 48
Watchers: 11
Forks: 10
Open Issues: 8
Type:phpcodesniffer-standard
Requires
- php: >=7.0
- dealerdirect/phpcodesniffer-composer-installer: ^1.0.0
- phpcompatibility/phpcompatibility-wp: ^2.1.0
- wp-coding-standards/wpcs: ^3.0.0
README
Collection of PHP_CodeSniffer sniffs for WooCommerce.
Installation
composer require woocommerce/woocommerce-sniffs
Usage
Command line
./vendor/bin/phpcs --standard=WooCommerce-Core <file>
Config file
PHPCS config file:
<?xml version="1.0"?> <ruleset name="WooCommerce Coding Standards"> <description>My projects ruleset.</description> <!-- Configs --> <config name="minimum_supported_wp_version" value="4.7" /> <config name="testVersion" value="7.2-" /> <!-- Rules --> <rule ref="WooCommerce-Core" /> <rule ref="WordPress.WP.I18n"> <properties> <property name="text_domain" type="array" value="new-text-domain" /> </properties> </rule> <rule ref="PHPCompatibility"> <exclude-pattern>tests/</exclude-pattern> </rule> </ruleset>