This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
understrap/phpcs.xml

106 lines
3.9 KiB
XML
Raw Normal View History

2017-01-26 18:15:24 +00:00
<?xml version="1.0"?>
2019-07-04 14:51:13 +00:00
<ruleset name="UnderStrap Coding Standards">
2017-01-26 18:15:24 +00:00
<!-- Set a description for this ruleset. -->
2019-07-04 14:51:13 +00:00
<description>A custom set of code standard rules for UnderStrap.</description>
<!-- Show colors in console -->
<arg value="-colors"/>
<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Don't show warnings -->
<arg value="n"/>
2017-01-26 18:15:24 +00:00
2019-06-26 16:33:58 +00:00
<!-- Only check the PHP files -->
<arg name="extensions" value="php"/>
<!-- Scan these files -->
<file>.</file>
<!-- Ignore the vendor directory -->
2019-07-04 14:51:13 +00:00
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
2019-06-26 16:33:58 +00:00
2019-07-04 14:51:13 +00:00
<!-- Use the WordPress Ruleset -->
<rule ref="WordPress">
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd"/>
<exclude name="WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed"/>
<exclude name="WordPress.Security.EscapeOutput.UnsafePrintingFunction"/>
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped"/>
<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotSanitized"/>
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited"/>
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralText"/>
2019-06-26 16:33:58 +00:00
2019-07-04 14:51:13 +00:00
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"/>
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed"/>
<exclude name="Generic.WhiteSpace.ScopeIndent"/>
2019-06-26 16:33:58 +00:00
2019-07-04 14:51:13 +00:00
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/>
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine"/>
<exclude name="PEAR.Functions.FunctionCallSignature.Indent"/>
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments"/>
2017-08-14 14:30:16 +00:00
2019-07-04 14:51:13 +00:00
<exclude name="Squiz.Commenting.FunctionComment.Missing"/>
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found"/>
<exclude name="Squiz.PHP.EmbeddedPhp"/>
</rule>
2017-08-14 14:30:16 +00:00
2019-07-04 14:51:13 +00:00
<!--
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">
<properties>
<property name="text_domain" type="array" value="understrap"/>
</properties>
2017-01-26 18:15:24 +00:00
</rule>
2019-07-04 14:51:13 +00:00
<!--
Allow for theme specific exceptions to the file name rules based
on the theme hierarchy.
-->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="is_theme" value="true"/>
</properties>
2017-08-14 14:30:16 +00:00
</rule>
2019-07-04 14:51:13 +00:00
<!-- A closing tag is not permitted at the end of a PHP file -->
<rule ref="Zend.Files.ClosingTag"/>
2019-07-04 14:51:13 +00:00
<!-- Use the PHPCompatibility Ruleset -->
<config name="testVersion" value="5.2-99.0"/>
<rule ref="PHPCompatibility">
<!--
Whitelist PHP native classes, interfaces, functions and constants which
are back-filled by WP.
Based on:
* /wp-includes/compat.php
* /wp-includes/random_compat/random.php
-->
<exclude name="PHPCompatibility.PHP.NewClasses.errorFound"/>
<exclude name="PHPCompatibility.PHP.NewClasses.typeerrorFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.json_pretty_printFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.php_version_idFound"/>
<exclude name="PHPCompatibility.PHP.NewFunctions.hash_equalsFound"/>
<exclude name="PHPCompatibility.PHP.NewFunctions.json_last_error_msgFound"/>
<exclude name="PHPCompatibility.PHP.NewFunctions.random_intFound"/>
<exclude name="PHPCompatibility.PHP.NewFunctions.random_bytesFound"/>
<exclude name="PHPCompatibility.PHP.NewFunctions.array_replace_recursiveFound"/>
<exclude name="PHPCompatibility.PHP.NewInterfaces.jsonserializableFound"/>
2017-08-14 14:30:16 +00:00
</rule>
2019-07-04 14:51:13 +00:00
2017-01-26 18:15:24 +00:00
</ruleset>