From 185d514977401bc27a9679fab59195cbea8e17f7 Mon Sep 17 00:00:00 2001 From: Terri Ann Swallow Date: Fri, 2 Feb 2024 14:20:29 -0500 Subject: [PATCH 1/3] Update install instructions * Include `--dev` in require commands * Use the full term `global` instead of the shorthand `g` * Mirror "Installation" section structure to the structure on WordPress/WordPress-Coding-Standards --- README.md | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1006b175..3b7d6d1b 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.com 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 From aac66cefc2c0ed9357077e40e5d66695e6ecf610 Mon Sep 17 00:00:00 2001 From: Terri Ann Swallow Date: Fri, 2 Feb 2024 14:24:06 -0500 Subject: [PATCH 2/3] Correct use of semantic heading --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b7d6d1b..6429f1f3 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer tru composer require --dev automattic/vipwpcs ``` -## Composer Global Installation +### Composer Global Installation Alternatively, it can be installed standard globally for use across multiple projects: From 26312cfa20d894b11b4fcae1f09a83d074302ad0 Mon Sep 17 00:00:00 2001 From: Gary Jones Date: Fri, 16 Feb 2024 16:05:51 +0000 Subject: [PATCH 3/3] Docs: Fix name of WPVIP --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6429f1f3..834900ec 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Go to https://docs.wpvip.com/technical-references/code-review/phpcs-report/ to l [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.com VIP](https://docs.wpvip.com/how-tos/code-review/php_codesniffer/) for more details. +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.