pressmodo/phpcs-config

Installs: 173

Dependents: 4

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

dev-master 2019-03-23 17:50 UTC

This package is auto-updated.

Last update: 2024-04-24 05:51:18 UTC


README

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>