mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-08-30 02:32:07 +08:00
71 lines
3 KiB
XML
71 lines
3 KiB
XML
<?xml version="1.0"?>
|
|
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="MainWP Child" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
|
|
|
|
<description>The Coding standard for the MainWP Child.</description>
|
|
|
|
<file>.</file>
|
|
|
|
<arg value="sp"/>
|
|
<arg name="extensions" value="php"/>
|
|
<arg name="basepath" value="."/>
|
|
<arg name="parallel" value="8"/>
|
|
|
|
<exclude-pattern>*/bin/*</exclude-pattern>
|
|
<exclude-pattern>*/.github/*</exclude-pattern>
|
|
<exclude-pattern>*/tests/*</exclude-pattern>
|
|
|
|
<rule ref="WordPress">
|
|
<exclude name="WordPress.Files.FileName"/>
|
|
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
|
|
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/>
|
|
|
|
<!-- Disable Nonce verification due to large number of false positives. -->
|
|
<exclude name="WordPress.Security.NonceVerification"/>
|
|
|
|
<!-- Disable Escaping output check due to large number of false positives. -->
|
|
<exclude name="WordPress.Security.EscapeOutput"/>
|
|
|
|
<!-- Disable Strict comparison check. Not applicable in the mojority of cases. -->
|
|
<exclude name="WordPress.PHP.StrictComparisons"/>
|
|
|
|
<!-- Disable Strict comparison in array check. Not applicable in the mojority of cases. -->
|
|
<exclude name="WordPress.PHP.StrictInArray"/>
|
|
|
|
<!-- Disable Misuse of WP internationalization function check. -->
|
|
<exclude name="WordPress.WP.I18n"/>
|
|
</rule>
|
|
|
|
<!-- Enforce PSR1 compatible namespaces. -->
|
|
<rule ref="PSR1.Classes.ClassDeclaration"/>
|
|
|
|
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
|
|
<properties>
|
|
<property name="alignMultilineItems" value="!=100"/>
|
|
<property name="exact" value="false" phpcs-only="true"/>
|
|
</properties>
|
|
</rule>
|
|
|
|
<rule ref="PSR2.Methods.FunctionClosingBrace"/>
|
|
|
|
<!-- Check code for cross-version PHP compatibility. -->
|
|
<config name="testVersion" value="5.4-"/>
|
|
<rule ref="PHPCompatibility">
|
|
<!-- Exclude PHP constants back-filled by PHPCS. -->
|
|
<exclude name="PHPCompatibility.Constants.NewConstants.t_finallyFound"/>
|
|
<exclude name="PHPCompatibility.Constants.NewConstants.t_yieldFound"/>
|
|
<exclude name="PHPCompatibility.Constants.NewConstants.t_ellipsisFound"/>
|
|
<exclude name="PHPCompatibility.Constants.NewConstants.t_powFound"/>
|
|
<exclude name="PHPCompatibility.Constants.NewConstants.t_pow_equalFound"/>
|
|
<exclude name="PHPCompatibility.Constants.NewConstants.t_spaceshipFound"/>
|
|
<exclude name="PHPCompatibility.Constants.NewConstants.t_coalesceFound"/>
|
|
<exclude name="PHPCompatibility.Constants.NewConstants.t_coalesce_equalFound"/>
|
|
<exclude name="PHPCompatibility.Constants.NewConstants.t_yield_fromFound"/>
|
|
</rule>
|
|
|
|
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.DeprecatedWhitelistCommentFound">
|
|
<!-- False positive for whitelist comment recognition, but no use fixing this now
|
|
as the WPCS native whitelist comments are deprecated anyhow. -->
|
|
<exclude-pattern>/WordPress/AbstractClassRestrictionsSniff\.php$</exclude-pattern>
|
|
</rule>
|
|
|
|
</ruleset>
|