| 1 |
<?xml version="1.0"?> |
| 2 |
<ruleset name="machete"> |
| 3 |
<description>A custom set of rules to check for a WPized WordPress project</description> |
| 4 |
|
| 5 |
<arg name="colors"/> |
| 6 |
<arg name="parallel" value="100"/> |
| 7 |
<arg name="extensions" value="php"/> |
| 8 |
|
| 9 |
<!-- Exclude WP Core folders and files from being checked. --> |
| 10 |
<!-- |
| 11 |
<exclude-pattern>/docroot/wp-admin/*</exclude-pattern> |
| 12 |
<exclude-pattern>/docroot/wp-includes/*</exclude-pattern> |
| 13 |
<exclude-pattern>/docroot/wp-*.php</exclude-pattern> |
| 14 |
<exclude-pattern>/docroot/index.php</exclude-pattern> |
| 15 |
<exclude-pattern>/docroot/xmlrpc.php</exclude-pattern> |
| 16 |
<exclude-pattern>/docroot/wp-content/plugins/*</exclude-pattern> |
| 17 |
--> |
| 18 |
|
| 19 |
<!-- Exclude the Composer Vendor directory. --> |
| 20 |
<exclude-pattern>/vendor/*</exclude-pattern> |
| 21 |
|
| 22 |
<!-- Exclude the Node Modules directory. --> |
| 23 |
<exclude-pattern>/node_modules/*</exclude-pattern> |
| 24 |
|
| 25 |
<!-- Exclude minified Javascript files. --> |
| 26 |
<exclude-pattern>*.min.js</exclude-pattern> |
| 27 |
|
| 28 |
<!-- Include the WordPress-Core standard. --> |
| 29 |
<rule ref="WordPress-Core" /> |
| 30 |
|
| 31 |
<!-- Include the WordPress-Extra standard. --> |
| 32 |
<rule ref="WordPress-Extra" /> |
| 33 |
|
| 34 |
<!-- Let's also check that everything is properly documented. --> |
| 35 |
<!-- <rule ref="WordPress-Docs"/> --> |
| 36 |
|
| 37 |
<!-- Add in some extra rules from other standards. --> |
| 38 |
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/> |
| 39 |
<!-- <rule ref="Generic.Commenting.Todo"/> --> |
| 40 |
|
| 41 |
<!-- Check for PHP cross-version compatibility. --> |
| 42 |
<!-- |
| 43 |
To enable this, the PHPCompatibility standard needs |
| 44 |
to be installed. |
| 45 |
See the readme for installation instructions: |
| 46 |
https://github.com/wimg/PHPCompatibility |
| 47 |
--> |
| 48 |
|
| 49 |
<config name="testVersion" value="8.4"/> |
| 50 |
<rule ref="PHPCompatibilityWP"/> |
| 51 |
|
| 52 |
<!-- |
| 53 |
To get the optimal benefits of using WPCS, we should add a couple of |
| 54 |
custom properties. |
| 55 |
Adjust the values of these properties to fit our needs. |
| 56 |
|
| 57 |
For information on additional custom properties available, check out |
| 58 |
the wiki: |
| 59 |
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties |
| 60 |
--> |
| 61 |
<config name="minimum_supported_wp_version" value="4.6"/> |
| 62 |
|
| 63 |
<rule ref="WordPress.WP.I18n"> |
| 64 |
<properties> |
| 65 |
<property name="text_domain" type="array"> |
| 66 |
<element value="machete"/> |
| 67 |
</property> |
| 68 |
</properties> |
| 69 |
</rule> |
| 70 |
|
| 71 |
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"> |
| 72 |
<properties> |
| 73 |
<property name="prefixes" type="array"> |
| 74 |
<element value="machete"/> |
| 75 |
</property> |
| 76 |
</properties> |
| 77 |
</rule> |
| 78 |
|
| 79 |
</ruleset> |
| 80 |
|