|
1 | 1 | <?xml version="1.0"?> |
2 | | -<ruleset name="WP-CLI"> |
3 | | - <description>WordPress Coding Standards for WP-CLI</description> |
4 | | - |
5 | | - <!-- Show sniff codes in all reports, and progress while running --> |
6 | | - <arg value="sp"/> |
7 | | - <!-- Check all PHP files in directory tree by default. --> |
8 | | - <arg name="extensions" value="php"/> |
9 | | - <!-- Run different reports --> |
10 | | - <arg name="report" value="full"/> |
11 | | - <arg name="report" value="summary"/> |
12 | | - <arg name="report" value="source"/> |
| 2 | +<ruleset name="WP-CLI-shell"> |
| 3 | + <description>Custom ruleset for WP-CLI-shell-command</description> |
13 | 4 |
|
| 5 | + <!-- |
| 6 | + ############################################################################# |
| 7 | + COMMAND LINE ARGUMENTS |
| 8 | + For help understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml |
| 9 | + For help using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage |
| 10 | + ############################################################################# |
| 11 | + --> |
| 12 | + |
| 13 | + <!-- What to scan. --> |
14 | 14 | <file>.</file> |
15 | | - <exclude-pattern>*/ci/*</exclude-pattern> |
16 | | - <exclude-pattern>*/features/*</exclude-pattern> |
17 | | - <exclude-pattern>*/packages/*</exclude-pattern> |
18 | | - <exclude-pattern>*/tests/*</exclude-pattern> |
19 | | - <exclude-pattern>*/utils/*</exclude-pattern> |
20 | | - <exclude-pattern>*/vendor/*</exclude-pattern> |
21 | | - |
22 | | - <rule ref="PHPCompatibility"> |
23 | | - <!-- Polyfill package is used so array_column() is available for PHP 5.4- --> |
24 | | - <exclude name="PHPCompatibility.PHP.NewFunctions.array_columnFound"/> |
25 | | - <!-- Both magic quotes directives set in wp-settings-cli.php to provide consistent starting point. --> |
26 | | - <exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_runtimeDeprecatedRemoved"/> |
27 | | - <exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_sybaseDeprecatedRemoved"/> |
28 | | - </rule> |
| 15 | + |
| 16 | + <!-- Show progress. --> |
| 17 | + <arg value="p"/> |
| 18 | + |
| 19 | + <!-- Strip the filepaths down to the relevant bit. --> |
| 20 | + <arg name="basepath" value="./"/> |
| 21 | + |
| 22 | + <!-- Check up to 8 files simultanously. --> |
| 23 | + <arg name="parallel" value="8"/> |
| 24 | + |
| 25 | + <!-- |
| 26 | + ############################################################################# |
| 27 | + USE THE WP_CLI_CS RULESET |
| 28 | + ############################################################################# |
| 29 | + --> |
| 30 | + |
| 31 | + <rule ref="WP_CLI_CS"/> |
| 32 | + |
| 33 | + <!-- |
| 34 | + ############################################################################# |
| 35 | + PROJECT SPECIFIC CONFIGURATION FOR SNIFFS |
| 36 | + ############################################################################# |
| 37 | + --> |
| 38 | + |
| 39 | + <!-- For help understanding the `testVersion` configuration setting: |
| 40 | + https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> |
29 | 41 | <config name="testVersion" value="5.4-"/> |
30 | 42 |
|
31 | | - <rule ref="WordPress-Core"> |
32 | | - <exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" /> |
33 | | - <exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar" /> |
34 | | - <exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase" /> |
35 | | - <exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase" /> |
36 | | - </rule> |
37 | | - <rule ref="WordPress.Files.FileName"> |
| 43 | + <!-- Verify that everything in the global namespace is either namespaced or prefixed. |
| 44 | + See: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace --> |
| 45 | + <rule ref="WordPress.NamingConventions.PrefixAllGlobals"> |
38 | 46 | <properties> |
39 | | - <property name="strict_class_file_names" value="false"/> |
| 47 | + <property name="prefixes" type="array" extend="true"> |
| 48 | + <element value="WP_CLI"/><!-- Namespaces. --> |
| 49 | + <element value="wpcli"/><!-- Global variables and such. --> |
| 50 | + </property> |
40 | 51 | </properties> |
41 | | - <exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> |
42 | 52 | </rule> |
| 53 | + |
| 54 | + <!-- |
| 55 | + ############################################################################# |
| 56 | + SELECTIVE EXCLUSIONS |
| 57 | + ############################################################################# |
| 58 | + --> |
| 59 | + |
| 60 | + <!-- Exclude existing classes from the prefix rule as it would break BC to prefix them now. --> |
| 61 | + <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound"> |
| 62 | + <exclude-pattern>*/src/Shell_Command\.php$</exclude-pattern> |
| 63 | + </rule> |
| 64 | + |
43 | 65 | </ruleset> |
0 commit comments