mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Add codesniffer config
This commit is contained in:
62
test/codesniffer/ruleset.xml
Executable file
62
test/codesniffer/ruleset.xml
Executable file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="Dolibarr">
|
||||
<description>Dolibarr coding standard.</description>
|
||||
|
||||
<!-- Include some specific sniffs -->
|
||||
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
|
||||
<rule ref="Generic.Commenting.Todo"/>
|
||||
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
|
||||
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
|
||||
<rule ref="Generic.Formatting.SpaceAfterCast"/>
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
|
||||
<rule ref="Generic.NamingConventions.ConstructorName"/>
|
||||
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
|
||||
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
|
||||
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
|
||||
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
|
||||
<rule ref="Generic.WhiteSpace.ScopeIndent"/>
|
||||
<rule ref="PEAR.ControlStructures.MultiLineCondition"/>
|
||||
<rule ref="PEAR.Files.IncludingFile"/>
|
||||
<rule ref="PEAR.Formatting.MultiLineAssignment"/>
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature"/>
|
||||
<rule ref="Zend.Debug.CodeAnalyzer"/>
|
||||
|
||||
<!-- Lines can be 85 chars long, but never show errors -->
|
||||
<rule ref="Generic.Files.LineLength">
|
||||
<properties>
|
||||
<property name="lineLimit" value="85"/>
|
||||
<property name="absoluteLineLimit" value="0"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Use Unix newlines -->
|
||||
<rule ref="Generic.Files.LineEndings">
|
||||
<properties>
|
||||
<property name="eolChar" value="\n"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Have 8 chars padding maximum and always show as errors -->
|
||||
<rule ref="Generic.Formatting.MultipleStatementAlignment">
|
||||
<properties>
|
||||
<property name="maxPadding" value="8"/>
|
||||
<property name="ignoreMultiLine" value="true"/>
|
||||
<property name="error" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Tweaks to metrics -->
|
||||
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="complexity" value="10"/>
|
||||
<property name="absoluteComplexity" value="100"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Generic.Metrics.NestingLevel">
|
||||
<properties>
|
||||
<property name="nestingLevel" value="5"/>
|
||||
<property name="absoluteNestingLevel" value="50"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
</ruleset>
|
||||
Reference in New Issue
Block a user