Skip to content

Commit afe2663

Browse files
committed
Docs: Update readme for VIPCS 2.0
1 parent 8030138 commit afe2663

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

README.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
1-
# VIP-Coding-Standards
1+
# VIP Coding Standards
22

3-
This project maintains the minimum ruleset of [PHP_CodeSniffer rules](https://github.com/squizlabs/PHP_CodeSniffer) (sniffs) to validate code developed for [WordPress.com VIP](https://wpvip.com/).
3+
This project contains [PHP_CodeSniffer (PHPCS) sniffs and rulesets](https://github.com/squizlabs/PHP_CodeSniffer) to validate code developed for [WordPress.com VIP](https://wpvip.com/).
44

5-
This project contains 2 PHP Codesniffer rulesets:
5+
This project contains two rulesets:
66

7-
- `WordPressVIPMinimum` - for use on WordPress.com projects
8-
- `WordPress-VIP-Go` - for use on VIP Go projects
7+
- `WordPressVIPMinimum` - for use with projects on the (older) WordPress.com VIP platform.
8+
- `WordPress-VIP-Go` - for use with projects on the (newer) VIP Go platform.
99

10-
These rulesets contain only the rules which are considered being "blockers" and "warnings" according to the [WordPress VIP Go documentation](https://wpvip.com/documentation/vip-go/code-review-blockers-warnings-notices/)
10+
These rulesets contain only the rules which are considered to be "errors" and "warnings" according to the [WordPress VIP Go documentation](https://wpvip.com/documentation/vip-go/code-review-blockers-warnings-notices/)
1111

12-
The ruleset takes advantage of existing rules in the [WordPress-Coding-Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) project.
12+
The rulesets use rules from the [WordPress-Coding-Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) (WPCS) project.
1313

14-
Go to https://wpvip.com/documentation/phpcs-review-feedback/ to learn about why various things are flagged as errors vs warnings and what the levels mean for us.
14+
Go to https://wpvip.com/documentation/phpcs-review-feedback/ to learn about why violations are flagged as errors vs warnings and what the levels mean.
1515

16-
## Installation
16+
## Minimal requirements
1717

18-
### Note
18+
* [PHPCS 3.3.1+](https://github.com/squizlabs/PHP_CodeSniffer/releases)
19+
* [WPCS 2.*](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/releases)
1920

20-
Currently, the VIP Go Coding Standards are built on top of the WordPress Coding Standards 1.* release. If you are using `master` here, you will need to checkout [1.2.1 tag](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/releases/tag/1.2.1).
21+
## Installation
2122

22-
First, make sure you have WPCS 1.* and PHPCS v3+ installed. If you do not, please refer to the [installation instructions for installing PHP CodeSniffer for WordPress.com VIP](https://vip.wordpress.com/documentation/how-to-install-php-code-sniffer-for-wordpress-com-vip/). Note that VIPCS does not currently work with the `develop` or `master` branch of WPCS.
23+
`composer require automattic/vipwpcs`, or `composer g require automattic/vipwpcs` if installing globally.
2324

24-
You will also find additional information at the [WordPress Coding Standards for PHP_CodeSniffer project](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards#installation).
25+
This will install the latest compatible versions of PHPCS and WPCS.
2526

26-
Then, clone this repo to your local machine, and add the standard to PHPCodeSniffer by appending the folder you cloned into to the end of the installed paths. e.g.
2727

28-
`phpcs --config-set installed_paths [/path/to/wpcsstandard],[path/to/vipcsstandard],etc`
28+
Please refer to the [installation instructions for installing PHP_CodeSniffer for WordPress.com VIP](https://wpvip.com/documentation/how-to-install-php-code-sniffer-for-wordpress-com-vip/) for more details.
2929

30-
Alternatively, we recommend the [PHP_CodeSniffer Standards Composer Installer Plugin](https://github.com/Dealerdirect/phpcodesniffer-composer-installer), which handles the registration of all of the installed standards, so there is no need to set the `installed_paths` config value manually, for single or multiple standards.
30+
We recommend the [PHP_CodeSniffer Standards Composer Installer Plugin](https://github.com/Dealerdirect/phpcodesniffer-composer-installer), which handles the registration of all of the installed standards, so there is no need to set the `installed_paths` config value manually, for single or multiple standards.
3131

32-
### Minimal requirements
32+
Alternatively, you should register the standard to PHPCS by appending the VIPCS directory to the end of the installed paths. e.g.
3333

34-
* [PHPCS 3+](https://github.com/squizlabs/PHP_CodeSniffer/releases)
35-
* [WPCS 1.*](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/releases)
34+
`phpcs --config-set installed_paths [/path/to/wpcsstandard],[path/to/vipcsstandard],etc`
3635

37-
### Setup note
36+
## Contribution
3837

39-
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:
38+
Please see [CONTRIBUTION.md](CONTRIBUTING.md).
4039

41-
`phpcs --config-set installed_paths [/path/to/standard],[path/to/standard]`
40+
## License
4241

43-
Note the comma separating each standard.
42+
Licensed under [GPL-2.0-or-later](LICENSE.md).

0 commit comments

Comments
 (0)