File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed
Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,38 @@ To make use of the WP-CLI testing framework, you need to complete the following
4141 ```
4242 This will make sure that the automated Behat system works across all platforms. This is needed on Windows.
4343
44- 5 . Update your composer dependencies and regenerate your autoloader and binary folders:
44+ 5 . Optionally add a ` phpcs.xml.dist ` file to the package root to enable code style and best practice checks using PHP_CodeSniffer.
45+
46+ Example of a minimal custom ruleset based on the defaults set in the WP-CLI testing framework:
47+ ``` xml
48+ <?xml version =" 1.0" ?>
49+ <ruleset name =" WP-CLI-PROJECT-NAME" >
50+ <description >Custom ruleset for WP-CLI PROJECT NAME</description >
51+
52+ <!-- What to scan. -->
53+ <file >.</file >
54+
55+ <!-- Show progress. -->
56+ <arg value =" p" />
57+
58+ <!-- Strip the filepaths down to the relevant bit. -->
59+ <arg name =" basepath" value =" ./" />
60+
61+ <!-- Check up to 8 files simultaneously. -->
62+ <arg name =" parallel" value =" 8" />
63+
64+ <!-- For help understanding the `testVersion` configuration setting:
65+ https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
66+ <config name =" testVersion" value =" 5.4-" />
67+
68+ <!-- Rules: Include the base ruleset for WP-CLI projects. -->
69+ <rule ref =" WP_CLI_CS" />
70+
71+ </ruleset >
72+ ```
73+
74+ All other [PHPCS configuration options](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset) are, of course, available.
75+ 6. Update your composer dependencies and regenerate your autoloader and binary folders:
4576 ```bash
4677 composer update
4778 ```
You can’t perform that action at this time.
0 commit comments