|
1 | 1 | <?xml version="1.0"?> |
2 | | -<ruleset name="WP-CLI"> |
3 | | - <description>Custom ruleset for WP-CLI</description> |
| 2 | +<ruleset name="WP-CLI-find"> |
| 3 | + <description>Custom ruleset for WP-CLI find-command</description> |
| 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 | + <file>.</file> |
4 | 15 |
|
5 | | - <!-- For help in understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> |
6 | | - <!-- For help in using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage --> |
| 16 | + <!-- Show progress. --> |
| 17 | + <arg value="p"/> |
7 | 18 |
|
8 | | - <!-- What to scan --> |
9 | | - <file>.</file> |
10 | | - <!-- Ignoring Files and Folders: |
11 | | - https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders --> |
12 | | - <exclude-pattern>*/.git/*</exclude-pattern> |
13 | | - <exclude-pattern>*/ci/*</exclude-pattern> |
14 | | - <exclude-pattern>*/features/*</exclude-pattern> |
15 | | - <exclude-pattern>*/packages/*</exclude-pattern> |
16 | | - <exclude-pattern>*/tests/*</exclude-pattern> |
17 | | - <exclude-pattern>*/utils/*</exclude-pattern> |
18 | | - <exclude-pattern>*/vendor/*</exclude-pattern> |
19 | | - |
20 | | - <!-- How to scan --> |
21 | | - <arg value="sp"/> <!-- Show sniff and progress --> |
22 | | - <arg name="colors"/> <!-- Show results with colors --> |
23 | | - <arg name="extensions" value="php"/> <!-- Limit to PHP files --> |
24 | | - |
25 | | - <!-- Rules: Check PHP version compatibility - see |
26 | | - https://github.com/PHPCompatibility/PHPCompatibilityWP --> |
27 | | - <rule ref="PHPCompatibilityWP"> |
28 | | - <!-- Polyfill package is used so array_column() is available for PHP 5.4- --> |
29 | | - <exclude name="PHPCompatibility.PHP.NewFunctions.array_columnFound"/> |
30 | | - <!-- Both magic quotes directives set in wp-settings-cli.php to provide consistent starting point. --> |
31 | | - <exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_runtimeDeprecatedRemoved"/> |
32 | | - <exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_sybaseDeprecatedRemoved"/> |
33 | | - </rule> |
| 19 | + <!-- Strip the filepaths down to the relevant bit. --> |
| 20 | + <arg name="basepath" value="./"/> |
34 | 21 |
|
35 | | - <!-- For help in understanding this testVersion: |
36 | | - https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> |
37 | | - <config name="testVersion" value="5.4-"/> |
| 22 | + <!-- Check up to 8 files simultaneously. --> |
| 23 | + <arg name="parallel" value="8"/> |
38 | 24 |
|
39 | | - <!-- Ignore php_uname mode issue, we're conditionally providing a callback --> |
40 | | - <rule ref="PHPCompatibility.PHP.NewFunctionParameters.php_uname_modeFound"> |
41 | | - <exclude-pattern>*/php/commands/src/CLI_Command.php</exclude-pattern> |
42 | | - </rule> |
| 25 | + <!-- |
| 26 | + ############################################################################# |
| 27 | + USE THE WP_CLI_CS RULESET |
| 28 | + ############################################################################# |
| 29 | + --> |
43 | 30 |
|
44 | | - <!-- Rules: WordPress Coding Standards - see |
45 | | - https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards --> |
46 | | - <rule ref="WordPress-Core"> |
47 | | - <exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" /> |
48 | | - <exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar" /> |
49 | | - <exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase" /> |
50 | | - <exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase" /> |
51 | | - </rule> |
| 31 | + <rule ref="WP_CLI_CS"/> |
| 32 | + |
| 33 | + <!-- |
| 34 | + ############################################################################# |
| 35 | + PROJECT SPECIFIC CONFIGURATION FOR SNIFFS |
| 36 | + ############################################################################# |
| 37 | + --> |
52 | 38 |
|
53 | | - <!-- For help in understanding these custom sniff properties: |
54 | | - https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties --> |
55 | | - <rule ref="WordPress.Files.FileName"> |
| 39 | + <!-- For help understanding the `testVersion` configuration setting: |
| 40 | + https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> |
| 41 | + <config name="testVersion" value="5.4-"/> |
| 42 | + |
| 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"> |
56 | 46 | <properties> |
57 | | - <property name="strict_class_file_names" value="false"/> |
| 47 | + <property name="prefixes" type="array"> |
| 48 | + <element value="WP_CLI\Find"/><!-- Namespaces. --> |
| 49 | + <element value="wpcli_find"/><!-- Global variables and such. --> |
| 50 | + </property> |
58 | 51 | </properties> |
59 | | - <exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> |
60 | 52 | </rule> |
| 53 | + |
61 | 54 | </ruleset> |
0 commit comments