Automattic / VIP-Coding-Standards

PHP_CodeSniffer ruleset to enforce WordPress VIP coding standards.
https://wpvip.com/documentation/how-to-install-php-code-sniffer-for-wordpress-com-vip/
Other
236 stars 40 forks source link

Installation instructions would be improved by linking to VIP's own install instructions #183

Closed benlk closed 5 years ago

benlk commented 6 years ago

README.md says:

Installation

Please refer to the installation instructions of WordPress Coding Standards for PHP_CodeSniffer project.

However, the installation instructions at https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/0.14.1/README.md do not contain any guidance on having multiple paths when using phpcs --config-set; the only examples given have a single directory listed.

https://vip.wordpress.com/documentation/how-to-install-php-code-sniffer-for-wordpress-com-vip/ provides the following useful example:

Should you wish to run both standards (WordPress.com VIP minimum standard & WordPress.com VIP coding standard), you can add both to PHPCS by running the following configuration command:

phpcs --config-set installed_paths [/path/to/standard],[path/to/standard]

If that's the only URL at which VIP wants to make that documentation example, then these coding standards should link to that URL. Otherwise, the docs here should include that example, and/or the docs in WordPress-Coding-Standards/WordPress-Coding-Standards should be extended to cover multiple test standards.

GaryJones commented 6 years ago

For WPCS, we recommend https://github.com/Dealerdirect/phpcodesniffer-composer-installer, which handles the registration of all of the installed standards - no new to set the installed_paths config value manually, for single or multiple standards.

benlk commented 6 years ago

That's very cool, and you should link to that from README.md in this repository and from https://vip.wordpress.com/documentation/how-to-install-php-code-sniffer-for-wordpress-com-vip/