|
7 | 7 | To include this ruleset in a WP-CLI project, use `rule ref="WP_CLI_CS"` in brackets. |
8 | 8 | See the instructions in the README/USING for an example. |
9 | 9 |
|
10 | | - For help using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage |
11 | | - For help understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml |
| 10 | + For help using PHPCS: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage |
| 11 | + For help understanding this file: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-ruleset.xml |
12 | 12 | --> |
13 | 13 |
|
14 | 14 | <!-- |
|
18 | 18 | --> |
19 | 19 |
|
20 | 20 | <!-- Ignoring select files/folders for all projects. |
21 | | - https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders --> |
| 21 | + https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders --> |
22 | 22 | <exclude-pattern>*/.git/*</exclude-pattern> |
23 | 23 | <exclude-pattern>*/node_modules/*</exclude-pattern> |
24 | 24 | <exclude-pattern>*/vendor/*</exclude-pattern> |
|
84 | 84 | </rule> |
85 | 85 |
|
86 | 86 |
|
| 87 | + <!-- |
| 88 | + ############################################################################# |
| 89 | + USE THE SLEVOMATCODINGSTANDARD RULESET |
| 90 | +
|
| 91 | + This checks code for unused `use` statements. |
| 92 | + See: https://github.com/slevomat/coding-standard |
| 93 | + ############################################################################# |
| 94 | + --> |
| 95 | + |
| 96 | + <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"> |
| 97 | + <properties> |
| 98 | + <property name="searchAnnotations" value="true"/> |
| 99 | + </properties> |
| 100 | + <!-- Exclude case-sensitivity check: PHPUnit's @dataProvider annotation uses a |
| 101 | + lowercase method name which can cause false positives with the DataProvider |
| 102 | + attribute class import (PHPUnit\Framework\Attributes\DataProvider). --> |
| 103 | + <exclude name="SlevomatCodingStandard.Namespaces.UnusedUses.MismatchingCaseSensitivity"/> |
| 104 | + </rule> |
| 105 | + |
| 106 | + |
87 | 107 | <!-- |
88 | 108 | ############################################################################# |
89 | 109 | SPECIFIC CONFIGURATION FOR SNIFFS |
|
0 commit comments