🔧 PHPCS: add section headings

This is intended to make it clearer for a newcomer to PHPCS to understand how the ruleset is build up and what each part of the ruleset means.
This commit is contained in:
jrfnl 2018-02-27 11:08:06 +01:00
parent 94767ab051
commit 92d8673e4a
1 changed files with 29 additions and 2 deletions

View File

@ -8,6 +8,14 @@
<!-- Set a description for this ruleset. --> <!-- Set a description for this ruleset. -->
<description>A custom set of code standard rules to check for WordPress themes.</description> <description>A custom set of code standard rules to check for WordPress themes.</description>
<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
#############################################################################
-->
<!-- Pass some flags to PHPCS: <!-- Pass some flags to PHPCS:
p flag: Show progress of the run. p flag: Show progress of the run.
s flag: Show sniff codes in all reports. s flag: Show sniff codes in all reports.
@ -22,13 +30,26 @@
<!-- Check all files in this directory and the directories below it. --> <!-- Check all files in this directory and the directories below it. -->
<file>.</file> <file>.</file>
<!-- Include the WordPress ruleset, with exclusions. -->
<!--
#############################################################################
USE THE WordPress RULESET
#############################################################################
-->
<rule ref="WordPress"> <rule ref="WordPress">
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/> <exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect"/> <exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect"/>
<exclude name="PEAR.Functions.FunctionCallSignature.Indent"/> <exclude name="PEAR.Functions.FunctionCallSignature.Indent"/>
</rule> </rule>
<!--
#############################################################################
SNIFF SPECIFIC CONFIGURATION
#############################################################################
-->
<!-- Verify that the text_domain is set to the desired text-domain. <!-- Verify that the text_domain is set to the desired text-domain.
Multiple valid text domains can be provided as a comma-delimited list. --> Multiple valid text domains can be provided as a comma-delimited list. -->
<rule ref="WordPress.WP.I18n"> <rule ref="WordPress.WP.I18n">
@ -54,7 +75,13 @@
</properties> </properties>
</rule> </rule>
<!-- Include sniffs for PHP cross-version compatibility. -->
<!--
#############################################################################
USE THE PHPCompatibility RULESET
#############################################################################
-->
<config name="testVersion" value="5.2-99.0"/> <config name="testVersion" value="5.2-99.0"/>
<rule ref="PHPCompatibility"/> <rule ref="PHPCompatibility"/>
</ruleset> </ruleset>