diff --git a/README.md b/README.md index 1006b175..834900ec 100644 --- a/README.md +++ b/README.md @@ -23,23 +23,29 @@ Go to https://docs.wpvip.com/technical-references/code-review/phpcs-report/ to l ## Installation -To install the VIP Coding Standards, run: -```bash -composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true -composer require automattic/vipwpcs -``` +[Composer](https://getcomposer.org/) will install the latest compatible versions of PHPCS, PHPCSUtils, PHPCSExtra, WPCS and VariableAnalysis and register the external standards with PHP_CodeSniffer. + +Please refer to the [installation instructions for installing PHP_CodeSniffer for WordPress VIP](https://docs.wpvip.com/how-tos/code-review/php_codesniffer/) for more details. + +As of VIPCS version 2.3.0, there is no need to `require` the [PHP_CodeSniffer Standards Composer Installer Plugin](https://github.com/PHPCSStandards/composer-installer) anymore as it is now a requirement of VIPCS itself. Permission to run the plugin will still need to be granted though when using Composer 2.2 or higher. + +### Composer Project-based Installation + +To install the VIP Coding Standards, run the following from the root of your project: -or if installing globally: ```bash -composer g config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true -composer g require automattic/vipwpcs +composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true +composer require --dev automattic/vipwpcs ``` -This will install the latest compatible versions of PHPCS, PHPCSUtils, PHPCSExtra, WPCS and VariableAnalysis and register the external standards with PHP_CodeSniffer. +### Composer Global Installation -Please refer to the [installation instructions for installing PHP_CodeSniffer for WordPress.com VIP](https://docs.wpvip.com/how-tos/code-review/php_codesniffer/) for more details. +Alternatively, it can be installed standard globally for use across multiple projects: -As of VIPCS version 2.3.0, there is no need to `require` the [PHP_CodeSniffer Standards Composer Installer Plugin](https://github.com/PHPCSStandards/composer-installer) anymore as it is now a requirement of VIPCS itself. Permission to run the plugin will still need to be granted though when using Composer 2.2 or higher. +```bash +composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true +composer global require --dev automattic/vipwpcs +``` ## Contribution