github.com/ddev/ddev@v1.23.2-0.20240519125000-d824ffe36ff3/pkg/ddevapp/wordpress/phpcs.xml.dist (about)

     1  <?xml version="1.0"?>
     2  <ruleset name="WordPress Plugin Coding Standards">
     3  	<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
     4  	<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
     5  	<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki -->
     6  
     7  	<!-- Set a description for this ruleset. -->
     8  	<description>A custom set of code standard rules to check for WordPress plugins.</description>
     9  
    10  
    11  	<!--
    12  	#############################################################################
    13  	COMMAND LINE ARGUMENTS
    14  	https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
    15  	#############################################################################
    16  	-->
    17  
    18  	<!-- Pass some flags to PHPCS:
    19  		 p flag: Show progress of the run.
    20  		 s flag: Show sniff codes in all reports.
    21  		 v flag: Print verbose output.
    22  		 n flag: Do not print warnings.
    23  	-->
    24  	<arg value="psvn"/>
    25  
    26  	<!-- Check up to 8 files simultanously. -->
    27  	<arg name="parallel" value="8"/>
    28  
    29  	<arg name="colors"/>
    30  
    31  	<!-- Only check the PHP files. CSS and SCSS files checked separately. JS files are checked separately with ESLint. -->
    32  	<arg name="extensions" value="php"/>
    33  
    34  	<!-- Check all files in this directory and the directories below it. -->
    35  	<file>.</file>
    36  
    37  	<exclude-pattern>*/dist/*</exclude-pattern>
    38  	<exclude-pattern>*/node_modules/*</exclude-pattern>
    39  	<exclude-pattern>*/tests/*</exclude-pattern>
    40  	<exclude-pattern>*/vendor/*</exclude-pattern>
    41  
    42  	<!--
    43  	#############################################################################
    44  	USE THE WordPress-Coding-Standards RULESET
    45  	#############################################################################
    46  	-->
    47  
    48  	<rule ref="WordPress"/>
    49  	<rule ref="WordPress-Core" />
    50  	<rule ref="WordPress-Docs" />
    51  	<rule ref="WordPress-Extra" />
    52  
    53  	<!--
    54  	#############################################################################
    55  	SNIFF SPECIFIC CONFIGURATION
    56  	#############################################################################
    57  	-->
    58  
    59  	<!-- Verify that the text_domain is set to the desired text-domain.
    60  		 Multiple valid text domains can be provided as a comma-delimited list. -->
    61    <!-- <rule ref="WordPress.WP.I18n">
    62  		<properties>
    63  			<property name="text_domain" type="array" value="text-domain"/>
    64  		</properties>
    65    </rule> -->
    66  
    67  	<!-- Allow for plugin specific exceptions to the file name rules based
    68  		 on the plugin hierarchy and ensure PSR-4 autoloading compatibility. -->
    69  	<rule ref="WordPress.Files.FileName">
    70  		<properties>
    71  			<property name="strict_class_file_names" value="false" />
    72  			<property name="is_plugin" value="true"/>
    73  		</properties>
    74  		<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
    75  	</rule>
    76  
    77  	<!-- Set the minimum supported WP version. This is used by several sniffs.
    78  		 The minimum version set here should be in line with the minimum WP version
    79  		 as set in the "Requires at least" tag in the readme.txt file. -->
    80  	<config name="minimum_supported_wp_version" value="5.0"/>
    81  
    82  	<rule ref="WordPress.Arrays.MultipleStatementAlignment">
    83  		<properties>
    84  			<!-- No need to adjust alignment of large arrays when the item with the largest key is removed. -->
    85  			<property name="exact" value="false"/>
    86  			<!-- Don't align multi-line items if ALL items in the array are multi-line. -->
    87  			<property name="alignMultilineItems" value="!=100"/>
    88  			<!-- Array assignment operator should always be on the same line as the array key. -->
    89  			<property name="ignoreNewlines" value="false"/>
    90  		</properties>
    91  	</rule>
    92  
    93  	<!--
    94  	#############################################################################
    95  	USE THE PHPCompatibility RULESET
    96  	#############################################################################
    97  	-->
    98  
    99  	<config name="testVersion" value="7.4-"/>
   100  	<rule ref="PHPCompatibilityWP" />
   101  
   102  </ruleset>