Skip to content

Pressmodo custom PHPCS rules for WordPress projects.

License

Notifications You must be signed in to change notification settings

Pressmodo/phpcs-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

Releases

No releases published

Packages

No packages published