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