Skip to content

Commit

Permalink
Composer: suggest composer plugin & update README
Browse files Browse the repository at this point in the history
Fixes the open actions for PR 855.
  • Loading branch information
jrfnl committed Jun 29, 2017
1 parent 14a198a commit e986171
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The WordPress Coding Standards are currently [not compatible with the upcoming P

### Composer

Standards can be installed with [Composer](https://getcomposer.org/) dependency manager:
Standards can be installed with the [Composer](https://getcomposer.org/) dependency manager:

composer create-project wp-coding-standards/wpcs --no-dev

Expand All @@ -60,6 +60,16 @@ Running this command will:

For convenience of using `phpcs` as global command you might want to add path to `wpcs/vendor/bin` directory to a `PATH` environment of your operating system.

#### Installing WPCS as a dependency

When installing the WordPress Coding Standards as a dependency in a larger project, the above mentioned step 3 will not be executed automatically.

There are two actively maintained Composer plugins which can handle the registration of standards with PHP_CodeSniffer for you:
* [composer-phpcodesniffer-standards-plugin](https://github.com/higidi/composer-phpcodesniffer-standards-plugin)
* [phpcodesniffer-composer-installer](https://github.com/DealerDirect/phpcodesniffer-composer-installer)

It is strongly suggested to `require` one of these plugins in your project to handle the registration of external standards with PHPCS for you.

### Standalone

1. Install PHP_CodeSniffer by following its [installation instructions](https://github.com/squizlabs/PHP_CodeSniffer#installation) (via Composer, PEAR, or Git checkout).
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"require" : {
"squizlabs/php_codesniffer": "^2.9.0"
},
"suggest" : {
"dealerdirect/phpcodesniffer-composer-installer": "*"
},
"minimum-stability" : "RC",
"support" : {
"issues": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues",
Expand Down

0 comments on commit e986171

Please sign in to comment.