Skip to content
Snippets Groups Projects
Select Git revision
  • a028eba8bc5535830256903d7041326338e78a13
  • master default protected
  • bugfix/vendor-excluded
  • feature/phpcs-editorconfig
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.2.8
  • 1.2.7
  • 1.2.6
  • 1.2.5
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1.1.0
  • 1.1.0-beta1
  • 1.0.1
  • 1.0.0
  • 1.0.0-beta8
  • 1.0.0-beta7
  • 1.0.0-beta6
  • 1.0.0-beta5
24 results

ruleset.xml

Blame
  • 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"/>