- Fixed phpstan.neon regex pattern for ignoring errors - Commented out missing Universal sniffs in phpcs.xml - Updated SonarCloud configuration to disable automatic analysis - Improved code-quality-checks.md documentation based on feedback - Added reminder about inline comment periods to .ai-assistant.md
67 lines
2.8 KiB
XML
67 lines
2.8 KiB
XML
<?xml version="1.0"?>
|
|
<ruleset name="WordPress Coding Standards">
|
|
<description>WordPress dev PHP_CodeSniffer ruleset.</description>
|
|
|
|
<!-- Check all PHP files in directory tree by default. -->
|
|
<file>.</file>
|
|
|
|
<exclude-pattern>*/vendor/*</exclude-pattern>
|
|
<exclude-pattern>*/node_modules/*</exclude-pattern>
|
|
<exclude-pattern>*/bin/*</exclude-pattern>
|
|
<exclude-pattern>*/.github/*</exclude-pattern>
|
|
<exclude-pattern>*/tests/*</exclude-pattern>
|
|
<exclude-pattern>libs/</exclude-pattern>
|
|
|
|
<arg name="extensions" value="php" />
|
|
<arg name="basepath" value="." />
|
|
<arg name="parallel" value="8" />
|
|
|
|
<!-- Configs -->
|
|
<config name="minimum_supported_wp_version" value="5.2" />
|
|
|
|
<!-- Rules -->
|
|
<rule ref="WordPress">
|
|
<exclude name="WordPress.NamingConventions.ValidVariableName" />
|
|
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition" />
|
|
|
|
<!-- Disable Strict comparison in array check. Not applicable in the majority of cases. -->
|
|
<exclude name="WordPress.PHP.StrictInArray" />
|
|
|
|
<exclude name="WordPress.WP.I18n" />
|
|
|
|
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
|
|
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching" />
|
|
|
|
<!-- Universal sniffs are commented out until the dependencies are properly installed -->
|
|
<!-- <exclude name="Universal.ControlStructures.DisallowAlternativeSyntax.FoundIfWithInlineHTML" /> -->
|
|
<!-- <exclude name="Universal.ControlStructures.DisallowAlternativeSyntax.FoundForeachWithInlineHTML" /> -->
|
|
<!-- <exclude name="Universal.ControlStructures.DisallowAlternativeSyntax.FoundIf" /> -->
|
|
<!-- <exclude name="Universal.ControlStructures.IfElseDeclaration.NoNewLine" /> -->
|
|
<!-- <exclude name="Universal.Classes.RequireFinalClass.NonFinalClassFound" /> -->
|
|
<!-- <exclude name="Universal.Namespaces.EnforceCurlyBraceSyntax.Forbidden" /> -->
|
|
|
|
<exclude name="Generic.Commenting.Todo" />
|
|
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition" />
|
|
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch" />
|
|
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
|
|
<exclude name="WordPress.WP.CapitalPDangit.Misspelled" />
|
|
</rule>
|
|
|
|
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
|
<properties>
|
|
<property name="indent" value="4"/>
|
|
<property name="tabIndent" value="false"/>
|
|
</properties>
|
|
</rule>
|
|
|
|
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
|
|
|
|
<rule ref="Generic.Formatting.MultipleStatementAlignment">
|
|
<properties>
|
|
<property name="maxPadding" value="1" />
|
|
<property name="error" value="false" />
|
|
</properties>
|
|
</rule>
|
|
|
|
</ruleset>
|