Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
106 lines (89 sloc) 5.47 KB
<?xml version="1.0"?>
<ruleset name="WordPress Theme Coding Standards">
<!-- See -->
<!-- See -->
<!-- See -->
<!-- See -->
<!-- Set a description for this ruleset. -->
<description>A custom set of code standard rules to check for WordPress themes.</description>
<!-- Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
v flag: Print verbose output.
n flag: Do not print warnings.
<arg value="psvn"/>
<!-- Only check the PHP, CSS and SCSS files. JS files are checked separately with JSCS and JSHint. -->
<arg name="extensions" value="php,css,scss/css"/>
<!-- Check all files in this directory and the directories below it. -->
<!-- Include the WordPress ruleset, with exclusions. -->
<rule ref="WordPress">
<!-- Nazi-strict intendation rules we want to exclude -->
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
<exclude name="WordPress.Arrays.ArrayIndentation.ItemNotAligned" />
<exclude name="WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned" />
<exclude name="WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed" />
<exclude name="WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned" />
<exclude name="PEAR.Functions.FunctionCallSignature.OpeningIndent" />
<!-- Don't require too strict inline commenting, it's a good thing to documentate, let's not make it frustrating -->
<exclude name="Squiz.Commenting.FunctionComment.WrongStyle" />
<exclude name="Squiz.Commenting.ClassComment.WrongStyle" />
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
<exclude name="Squiz.Commenting.FunctionComment.Missing" />
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag" />
<exclude name="Squiz.Commenting.InlineComment.SpacingAfter" />
<exclude name="Squiz.Commenting.FileComment.Missing" />
<exclude name="Squiz.Commenting.LongConditionClosingComment.Missing" />
<!-- General code style related excludes -->
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" />
<exclude name="Squiz.PHP.EmbeddedPhp.MultipleStatements" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterOpen" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd" />
<exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeKeyFound" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound" />
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace" />
<exclude name="PHPCompatibility.PHP.NewFunctionArrayDereferencing.Found" />
<!-- General WordPress stuff we like to overrule -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<!-- Very strict VIP/discouraged rules that are not needed -->
<exclude name="WordPress.VIP.RestrictedFunctions" />
<exclude name="WordPress.VIP.AdminBarRemoval.RemovalDetected" />
<exclude name="WordPress.VIP.OrderByRand" />
<exclude name="WordPress.VIP.OrderByRand.orderby" />
<exclude name="WordPress.VIP.ValidatedSanitizedInput.MissingUnslash" />
<exclude name="WordPress.XSS.EscapeOutput.OutputNotEscaped" />
<exclude name="WordPress.Functions.DontExtract.extract_extract" />
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma" />
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<exclude name="Squiz.PHP.EmbeddedPhp.NoSemicolon" />
<exclude name="PHPCompatibility.PHP.NewClosure.Found" />
<!-- Translations related, not always necessary, too strict -->
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment" />
<!-- EditorConfig makes sure this happens anyway & false positives happen with this -->
<exclude name="Generic.Files.EndFileNewline.NotFound" />
<!-- Many times when developing a customer case we have placeholders for SVG includes, so unnecessary error reports happen with this rule -->
<exclude name="Squiz.PHP.EmbeddedPhp.Empty" />
<!-- 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">
<property name="text_domain" type="array" value="air-light" />
<!-- Allow for theme specific exceptions to the file name rules based
on the theme hierarchy. -->
<rule ref="WordPress.Files.FileName">
<property name="is_theme" value="true" />
<!-- Include sniffs for PHP cross-version compatibility. -->
<config name="testVersion" value="5.6-99.0"/>
<rule ref="PHPCompatibility"/>
You can’t perform that action at this time.