Composer library to provide drop in installation and configuration of WPCS and PHPCompatibilityWP, setting reasonable defaults for WordPress development with nearly zero configuration.
Install the library via Composer:
$ composer require --dev pressmodo/phpcs-config:dev-master
That's it!
Lint your PHP files with the following command:
$ ./vendor/bin/phpcs .
If relying on Composer, edited the composer.json
file by adding the following:
"scripts": {
"lint": "phpcs .",
"lint-fix": "phpcbf ."
}
Then lint via:
$ composer run lint
Some IDE integrations of PHPCS fail to register the Pressmodo-Default
ruleset. In order to rectify this, place .phpcs.xml.dist
at your project root:
<?xml version="1.0"?>
<ruleset name="Project Rules">
<rule ref="Pressmodo-Default" />
</ruleset>