95 lines
3.2 KiB
XML
95 lines
3.2 KiB
XML
<?xml version="1.0"?>
|
|
<ruleset name="acorn-starter">
|
|
<description>WordPress Coding Standards for acorn-starter.</description>
|
|
|
|
<file>app</file>
|
|
<file>resources/views</file>
|
|
<file>index.php</file>
|
|
<file>bootstrap.php</file>
|
|
|
|
<exclude-pattern>/vendor/*</exclude-pattern>
|
|
<exclude-pattern>/node_modules/*</exclude-pattern>
|
|
|
|
<arg value="sp"/>
|
|
<arg name="extensions" value="php"/>
|
|
<arg name="basepath" value="."/>
|
|
<arg name="parallel" value="8"/>
|
|
|
|
<!-- PSR-12 is the house style (spaces, short arrays, no Yoda). -->
|
|
<rule ref="PSR12"/>
|
|
|
|
<!-- Keep the WordPress sniffs that catch real bugs, not house style. -->
|
|
<rule ref="WordPress.Security"/>
|
|
<rule ref="WordPress.DB.PreparedSQL"/>
|
|
<rule ref="WordPress.DB.PreparedSQLPlaceholders"/>
|
|
<rule ref="WordPress.WP.AlternativeFunctions"/>
|
|
<rule ref="WordPress.WP.GlobalVariablesOverride"/>
|
|
|
|
<!-- We use PSR-4 file naming (Foo.php), not WPCS's class-foo.php convention. -->
|
|
<rule ref="WordPress.Files.FileName">
|
|
<properties>
|
|
<property name="strict_class_file_names" value="false"/>
|
|
</properties>
|
|
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
|
|
</rule>
|
|
|
|
<rule ref="WordPress.WP.I18n">
|
|
<properties>
|
|
<property name="text_domain" type="array">
|
|
<element value="acorn-starter"/>
|
|
</property>
|
|
</properties>
|
|
</rule>
|
|
|
|
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
|
|
<properties>
|
|
<property name="prefixes" type="array">
|
|
<element value="acorn_starter"/>
|
|
<element value="AcornPlugin"/>
|
|
<element value="ACORN_STARTER"/>
|
|
</property>
|
|
</properties>
|
|
</rule>
|
|
|
|
<!--
|
|
Blade view templates use locally-scoped template variables and inline
|
|
echo, which PSR-12's brace sniffs and the "prefix all globals" sniff are
|
|
not designed for. Scope those out for views only; the sniffs that actually
|
|
matter for templates (output escaping, i18n, input validation, real WP
|
|
global collisions) stay active.
|
|
-->
|
|
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound">
|
|
<exclude-pattern>resources/views/*</exclude-pattern>
|
|
</rule>
|
|
<rule ref="Squiz.ControlStructures.ControlSignature">
|
|
<exclude-pattern>resources/views/*</exclude-pattern>
|
|
</rule>
|
|
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace">
|
|
<exclude-pattern>resources/views/*</exclude-pattern>
|
|
</rule>
|
|
<rule ref="Generic.Files.LineLength">
|
|
<exclude-pattern>resources/views/*</exclude-pattern>
|
|
</rule>
|
|
|
|
<!--
|
|
The plugin entry files are the textbook PSR1 exception: index.php carries
|
|
the plugin header and includes bootstrap.php; bootstrap.php boots the
|
|
framework and registers hooks. Declaring symbols and causing side effects
|
|
in one file is expected for these entry points, as it is for Blade views.
|
|
-->
|
|
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
|
|
<exclude-pattern>index.php</exclude-pattern>
|
|
<exclude-pattern>bootstrap.php</exclude-pattern>
|
|
<exclude-pattern>resources/views/*</exclude-pattern>
|
|
</rule>
|
|
|
|
<!-- Pure-markup Blade partials (e.g. hello-world.blade.php) legitimately
|
|
contain no PHP; the "no code found" notice does not apply to them. -->
|
|
<rule ref="Internal.NoCodeFound">
|
|
<severity>0</severity>
|
|
</rule>
|
|
|
|
<config name="testVersion" value="8.2-"/>
|
|
<rule ref="PHPCompatibilityWP"/>
|
|
</ruleset>
|