Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.05 KB

readme.md

File metadata and controls

46 lines (32 loc) · 1.05 KB

Pressmodo PHPCS Configuration

Composer library to provide drop in installation and configuration of WPCS and PHPCompatibilityWP, setting reasonable defaults for WordPress development with nearly zero configuration.

Installation

Install the library via Composer:

$ composer require --dev pressmodo/phpcs-config:dev-master

That's it!

Usage

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

IDE Integration

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>