Select Git revision
ruleset.xml
-
Bartek Jaskulski authored
Signed-off-by:
Bart Jaskulski <bjaskulski@protonmail.com>
Bartek Jaskulski authoredSigned-off-by:
Bart Jaskulski <bjaskulski@protonmail.com>
ruleset.xml 6.76 KiB
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WPDeskPlugin">
<description>Sniffs for WordPress WPDesk plugins</description>
<!-- Always exclude all files in version management related directories. -->
<exclude-pattern>*/.git/*</exclude-pattern>
<exclude-pattern>*/.wordpress-svn/*</exclude-pattern>
<!-- Always exclude all files in dependency related directories. -->
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor(_prefixed)?/*</exclude-pattern>
<!-- Always exclude all tests. Differences between PHPUnit, mocking libraries and WPCS make it hard to enforce some CS. -->
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>scoper\.inc\.php$</exclude-pattern>
<rule ref="WordPress">
<!-- Follow PSR-4 for autoloading naming convention -->
<exclude name="WordPress.Files.FileName"/>
<!-- WPCS demands long arrays. WPDeskCS demands short arrays. -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<!-- Demanding Yoda conditions is stupid. -->
<exclude name="WordPress.PHP.YodaConditions"/>
<!-- The only required comments are for the classes. -->
<exclude name="Squiz.Commenting.FunctionComment"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<!-- You can use short if-else form. -->
<exclude name="Universal.Operators.DisallowShortTernary"/>
<!-- If a conscious choice has been made for a non-strict comparison, that's ok.
I.e. when `strict` has been explicitly set to `false` in an array comparison,
it will be allowed. -->
<exclude name="WordPress.PHP.StrictInArray.FoundNonStrictFalse"/>
<exclude name="WordPress.WP.AlternativeFunctions" />
<!-- Sometimes it's better not to use user's timezone. -->
<exclude name="WordPress.DateTime.RestrictedFunctions.date_date" />
<!-- Since WPCS 3.0 exceptions are treated as output and requires escaping. We don't want that... -->
<exclude name="WordPress.Security.EscapeOutput.ExceptionNotEscaped" />
</rule>
<!-- Allow slash in hook name. -->
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="/"/>
</properties>
</rule>
<!-- By default register WooCommerce capabilities as known. -->
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array">
<element value="view_woocommerce_reports"/>
<element value="manage_woocommerce"/>
<element value="edit_shop_order"/>
<element value="read_shop_order"/>
<element value="delete_shop_order"/>
<element value="edit_shop_orders"/>
<element value="edit_others_shop_orders"/>
<element value="publish_shop_orders"/>
<element value="read_private_shop_orders"/>
<element value="delete_shop_orders"/>