2016-08-27 14:18:14 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<ruleset name="WordPress Coding Standards">
|
2017-09-27 16:07:41 +00:00
|
|
|
<description>WooCommerce dev PHP_CodeSniffer ruleset.</description>
|
2016-08-27 14:18:14 +00:00
|
|
|
|
2019-12-18 13:26:36 +00:00
|
|
|
<file>.</file>
|
|
|
|
|
2017-11-09 18:32:04 +00:00
|
|
|
<!-- Exclude paths -->
|
|
|
|
<exclude-pattern>tests/cli/</exclude-pattern>
|
|
|
|
<exclude-pattern>includes/libraries/</exclude-pattern>
|
2018-03-07 21:48:56 +00:00
|
|
|
<exclude-pattern>includes/legacy/</exclude-pattern>
|
2017-11-09 18:32:04 +00:00
|
|
|
<exclude-pattern>includes/api/legacy/</exclude-pattern>
|
2017-11-28 20:16:45 +00:00
|
|
|
<exclude-pattern>includes/api/v1/</exclude-pattern>
|
2018-03-15 20:23:40 +00:00
|
|
|
<exclude-pattern>includes/class-wc-geo-ip.php</exclude-pattern>
|
2018-03-07 21:48:56 +00:00
|
|
|
<exclude-pattern>includes/wc-deprecated-functions.php</exclude-pattern>
|
2017-11-21 12:41:55 +00:00
|
|
|
<exclude-pattern>*/node_modules/*</exclude-pattern>
|
|
|
|
<exclude-pattern>*/vendor/*</exclude-pattern>
|
2020-11-18 21:54:20 +00:00
|
|
|
<exclude-pattern>lib/</exclude-pattern>
|
2017-11-09 18:32:04 +00:00
|
|
|
|
2019-12-18 13:26:36 +00:00
|
|
|
<!-- Show progress, show the error codes for each message (source). -->
|
2019-12-20 15:46:57 +00:00
|
|
|
<arg value="ps" />
|
2019-12-18 13:26:36 +00:00
|
|
|
|
2019-12-20 12:09:14 +00:00
|
|
|
<!-- Strip the filepaths in reports down to the relevant bit. -->
|
2019-12-20 15:46:57 +00:00
|
|
|
<arg name="basepath" value="./" />
|
2019-12-18 13:26:36 +00:00
|
|
|
|
|
|
|
<!-- Check up to 8 files simultaneously. -->
|
2019-12-20 15:46:57 +00:00
|
|
|
<arg name="parallel" value="8" />
|
2019-12-18 13:26:36 +00:00
|
|
|
|
2017-11-21 12:41:55 +00:00
|
|
|
<!-- Configs -->
|
2020-07-15 21:29:13 +00:00
|
|
|
<config name="minimum_supported_wp_version" value="5.2" />
|
2020-04-07 00:07:33 +00:00
|
|
|
<config name="testVersion" value="7.0-" />
|
2017-11-21 12:41:55 +00:00
|
|
|
|
2017-11-21 12:47:42 +00:00
|
|
|
<!-- Rules -->
|
2017-12-21 23:29:49 +00:00
|
|
|
<rule ref="WooCommerce-Core" />
|
2017-11-09 18:32:04 +00:00
|
|
|
|
2020-08-06 07:54:29 +00:00
|
|
|
<rule ref="WooCommerce.Functions.InternalInjectionMethod">
|
|
|
|
<include-pattern>src/</include-pattern>
|
|
|
|
<include-pattern>tests/php/src/</include-pattern>
|
|
|
|
<properties>
|
2020-08-07 21:28:29 +00:00
|
|
|
<property name="injectionMethod" value="init"/>
|
2020-08-06 07:54:29 +00:00
|
|
|
</properties>
|
|
|
|
</rule>
|
|
|
|
|
2017-11-21 12:41:55 +00:00
|
|
|
<rule ref="WordPress.WP.I18n">
|
|
|
|
<properties>
|
|
|
|
<property name="text_domain" type="array" value="woocommerce" />
|
|
|
|
</properties>
|
|
|
|
</rule>
|
2018-11-06 22:58:50 +00:00
|
|
|
|
|
|
|
<rule ref="PHPCompatibility">
|
|
|
|
<exclude-pattern>tests/</exclude-pattern>
|
|
|
|
</rule>
|
|
|
|
|
2017-11-27 12:57:16 +00:00
|
|
|
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
|
|
|
|
<exclude-pattern>includes/**/abstract-*.php</exclude-pattern>
|
2020-07-15 23:09:00 +00:00
|
|
|
<exclude-pattern>tests/</exclude-pattern>
|
|
|
|
<exclude-pattern>src/</exclude-pattern>
|
|
|
|
<exclude-pattern>tests/php/src/</exclude-pattern>
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
<rule ref="Squiz.Classes.ClassFileName">
|
|
|
|
<include-pattern>src/</include-pattern>
|
|
|
|
<include-pattern>tests/php/src/</include-pattern>
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
<rule ref="Squiz.Classes.ValidClassName">
|
|
|
|
<include-pattern>src/</include-pattern>
|
|
|
|
<include-pattern>tests/php/src/</include-pattern>
|
2017-11-27 12:57:16 +00:00
|
|
|
</rule>
|
2018-11-06 22:58:50 +00:00
|
|
|
|
2018-01-22 03:23:48 +00:00
|
|
|
<rule ref="Generic.Commenting">
|
|
|
|
<exclude-pattern>tests/</exclude-pattern>
|
|
|
|
</rule>
|
2018-11-06 22:58:50 +00:00
|
|
|
|
2018-01-22 03:42:05 +00:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
|
|
|
|
<exclude-pattern>tests/e2e-tests/</exclude-pattern>
|
|
|
|
</rule>
|
2018-03-06 11:08:28 +00:00
|
|
|
|
2018-03-06 13:32:56 +00:00
|
|
|
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
|
|
|
|
<exclude-pattern>i18n/</exclude-pattern>
|
2019-06-25 12:13:04 +00:00
|
|
|
<exclude-pattern>src/</exclude-pattern>
|
2020-05-05 13:52:21 +00:00
|
|
|
<exclude-pattern>tests/php</exclude-pattern>
|
2020-05-18 09:31:59 +00:00
|
|
|
<exclude-pattern>tests/Tools/</exclude-pattern>
|
2018-03-06 13:32:56 +00:00
|
|
|
</rule>
|
2020-07-15 21:29:13 +00:00
|
|
|
|
2020-08-05 17:39:10 +00:00
|
|
|
<rule ref="Squiz.Commenting.FileComment.MissingPackageTag">
|
|
|
|
<exclude-pattern>src/</exclude-pattern>
|
|
|
|
<exclude-pattern>tests/php/</exclude-pattern>
|
|
|
|
</rule>
|
|
|
|
<rule ref="Squiz.Commenting.FileComment.Missing">
|
|
|
|
<exclude-pattern>src/</exclude-pattern>
|
|
|
|
<exclude-pattern>tests/php/</exclude-pattern>
|
|
|
|
</rule>
|
|
|
|
|
2020-07-15 21:29:13 +00:00
|
|
|
<rule ref="Squiz.Commenting.FunctionCommentThrowTag.Missing">
|
|
|
|
<exclude-pattern>tests/php/</exclude-pattern>
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
<rule ref="Squiz.Commenting.FileComment.Missing">
|
|
|
|
<exclude-pattern>tests/php/</exclude-pattern>
|
|
|
|
</rule>
|
2016-08-27 14:18:14 +00:00
|
|
|
</ruleset>
|