| 1 |
<?xml version="1.0"?> |
| 2 |
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin"> |
| 3 |
<description>Generally-applicable sniffs for WordPress plugins.</description> |
| 4 |
|
| 5 |
<!-- What to scan --> |
| 6 |
<file>.</file> |
| 7 |
<exclude-pattern>/vendor/</exclude-pattern> |
| 8 |
<exclude-pattern>/node_modules/</exclude-pattern> |
| 9 |
<exclude-pattern>/tests/*</exclude-pattern> |
| 10 |
|
| 11 |
<!-- How to scan --> |
| 12 |
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage --> |
| 13 |
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> |
| 14 |
<arg value="sp"/> <!-- Show sniff and progress --> |
| 15 |
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit --> |
| 16 |
<arg name="colors"/> |
| 17 |
<arg name="extensions" value="php"/> |
| 18 |
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. --> |
| 19 |
|
| 20 |
<!-- Rules: Check PHP version compatibility --> |
| 21 |
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> |
| 22 |
<config name="testVersion" value="5.6-"/> |
| 23 |
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP --> |
| 24 |
<rule ref="PHPCompatibilityWP"/> |
| 25 |
|
| 26 |
<!-- Rules: WordPress Coding Standards --> |
| 27 |
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards --> |
| 28 |
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties --> |
| 29 |
<config name="minimum_supported_wp_version" value="4.6"/> |
| 30 |
<rule ref="WordPress"> |
| 31 |
<!-- Unable to fix --> |
| 32 |
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/> |
| 33 |
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound"/> |
| 34 |
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound"/> |
| 35 |
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching"/> |
| 36 |
|
| 37 |
<!-- TODO: Maybe fix --> |
| 38 |
<exclude name="WordPress.WP.CronInterval.ChangeDetected"/> |
| 39 |
<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery"/> |
| 40 |
</rule> |
| 41 |
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"> |
| 42 |
<properties> |
| 43 |
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. --> |
| 44 |
<property name="prefixes" type="array"> |
| 45 |
<element value="wpbp"/> |
| 46 |
</property> |
| 47 |
</properties> |
| 48 |
|
| 49 |
<!-- TODO: Maybe fix --> |
| 50 |
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound"/> |
| 51 |
</rule> |
| 52 |
<rule ref="WordPress.WP.I18n"> |
| 53 |
<properties> |
| 54 |
<!-- Value: replace the text domain used. --> |
| 55 |
<property name="text_domain" type="array"> |
| 56 |
<element value="wp-background-processing"/> |
| 57 |
</property> |
| 58 |
</properties> |
| 59 |
|
| 60 |
<!-- TODO: Should fix --> |
| 61 |
<exclude name="WordPress.WP.I18n.MissingArgDomain"/> |
| 62 |
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/> |
| 63 |
</rule> |
| 64 |
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing"> |
| 65 |
<properties> |
| 66 |
<property name="blank_line_check" value="true"/> |
| 67 |
</properties> |
| 68 |
</rule> |
| 69 |
</ruleset> |
| 70 |
|