forked from mirror/_s
🔧 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:
parent
94767ab051
commit
92d8673e4a
|
@ -8,6 +8,14 @@
|
|||
<!-- Set a description for this ruleset. -->
|
||||
<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:
|
||||
p flag: Show progress of the run.
|
||||
s flag: Show sniff codes in all reports.
|
||||
|
@ -22,13 +30,26 @@
|
|||
<!-- Check all files in this directory and the directories below it. -->
|
||||
<file>.</file>
|
||||
|
||||
<!-- Include the WordPress ruleset, with exclusions. -->
|
||||
|
||||
<!--
|
||||
#############################################################################
|
||||
USE THE WordPress RULESET
|
||||
#############################################################################
|
||||
-->
|
||||
|
||||
<rule ref="WordPress">
|
||||
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
|
||||
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect"/>
|
||||
<exclude name="PEAR.Functions.FunctionCallSignature.Indent"/>
|
||||
</rule>
|
||||
|
||||
|
||||
<!--
|
||||
#############################################################################
|
||||
SNIFF SPECIFIC CONFIGURATION
|
||||
#############################################################################
|
||||
-->
|
||||
|
||||
<!-- Verify that the text_domain is set to the desired text-domain.
|
||||
Multiple valid text domains can be provided as a comma-delimited list. -->
|
||||
<rule ref="WordPress.WP.I18n">
|
||||
|
@ -54,7 +75,13 @@
|
|||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Include sniffs for PHP cross-version compatibility. -->
|
||||
|
||||
<!--
|
||||
#############################################################################
|
||||
USE THE PHPCompatibility RULESET
|
||||
#############################################################################
|
||||
-->
|
||||
|
||||
<config name="testVersion" value="5.2-99.0"/>
|
||||
<rule ref="PHPCompatibility"/>
|
||||
</ruleset>
|
||||
|
|
Reference in New Issue