Create new phpcs rules
This commit is contained in:
43
phpcs-templates.xml
Normal file
43
phpcs-templates.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="Roots">
|
||||
<description>Roots Templates Coding Standards</description>
|
||||
|
||||
<!-- Scan these files by default -->
|
||||
<file>templates</file>
|
||||
|
||||
<!-- Show colors in console -->
|
||||
<arg value="-colors"/>
|
||||
|
||||
<!-- Show sniff codes in all reports -->
|
||||
<arg value="s"/>
|
||||
|
||||
<!-- Use PSR-2 as a base -->
|
||||
<rule ref="PSR2">
|
||||
<!-- Allow closing braces to be on the same line -->
|
||||
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace"/>
|
||||
|
||||
<!-- Disable newline after opening brace -->
|
||||
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
|
||||
|
||||
<!-- Allow multiple PHP statements in the same line -->
|
||||
<exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
|
||||
|
||||
<!-- Disable PSR-2 indentation rules that are buggy with 2 spaces -->
|
||||
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BreakIndent"/>
|
||||
<exclude name="PSR2.Methods.FunctionCallSignature.Indent"/>
|
||||
|
||||
<!-- Don't require a blank line after the last `use` -->
|
||||
<exclude name="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse"/>
|
||||
|
||||
<!-- Allow PHP closing tags -->
|
||||
<exclude name="PSR2.Files.ClosingTag.NotAllowed"/>
|
||||
</rule>
|
||||
|
||||
<!-- Force 2 spaces indentation -->
|
||||
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
||||
<properties>
|
||||
<property name="indent" value="2"/>
|
||||
<property name="tabIndent" value="false"/>
|
||||
</properties>
|
||||
</rule>
|
||||
</ruleset>
|
||||
Reference in New Issue
Block a user