1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-26 20:24:39 +01:00

Base code sniffer ruleset on PSR2 rather than PEAR.

This commit is contained in:
Andreas Fischer 2015-07-08 16:48:57 +02:00
parent 00f17aa956
commit 9283aaa36b
2 changed files with 24 additions and 69 deletions

View File

@ -6,16 +6,6 @@
<!-- In general rules that apply to library code also apply to tests. -->
<rule ref="./code-sniffer-ruleset.xml">
<!-- Exceptions to the library coding standard follow. -->
<!-- We do not care too much about method, class and file documentation,
but having @author, @copyright and @license tags would be nice.
The following configuration does not check for these tags, but
complains if the file doc block is missing completely. -->
<exclude name="PEAR.Commenting.ClassComment" />
<exclude name="PEAR.Commenting.FunctionComment" />
<exclude name="PEAR.Commenting.FileComment.MissingTag" />
<exclude name="PEAR.Commenting.FileComment.MissingVersion" />
<exclude name="PEAR.Commenting.FileComment.SpacingBeforeTags" />
</rule>
</ruleset>

View File

@ -3,35 +3,30 @@
<description>phpseclib coding standard</description>
<!-- We are using the PEAR standard as a base -->
<rule ref="PEAR">
<!-- Temporary exceptions to the PEAR standard follow -->
<exclude name="Generic.ControlStructures.InlineControlStructure.Discouraged" />
<exclude name="Generic.Files.LineLength.TooLong" />
<exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital" />
<exclude name="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps" />
<exclude name="PEAR.Commenting.ClassComment.InvalidVersion" />
<exclude name="PEAR.Commenting.ClassComment.MissingTag" />
<exclude name="PEAR.Commenting.FileComment.EmptyCopyright" />
<exclude name="PEAR.Commenting.FileComment.InvalidVersion" />
<exclude name="PEAR.Commenting.FunctionComment.ExtraParamComment" />
<exclude name="PEAR.Commenting.FunctionComment.MissingReturn" />
<exclude name="PEAR.Commenting.FunctionComment.MissingParamComment" />
<exclude name="PEAR.Commenting.FunctionComment.MissingParamName" />
<exclude name="PEAR.Commenting.FunctionComment.MissingParamTag" />
<exclude name="PEAR.Commenting.FunctionComment.ParameterCommentsNotAligned" />
<exclude name="PEAR.Commenting.FunctionComment.ParameterNamesNotAligned" />
<exclude name="PEAR.Commenting.FunctionComment.ParamNameNoMatch" />
<exclude name="PEAR.Commenting.FunctionComment.SpacingAfterParams" />
<exclude name="PEAR.Commenting.FunctionComment.SpacingBeforeParams" />
<exclude name="PEAR.Commenting.FunctionComment.SpacingBeforeTags" />
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket" />
<exclude name="PEAR.WhiteSpace.ScopeClosingBrace.BreakIdent" />
<exclude name="PEAR.WhiteSpace.ScopeClosingBrace.Indent" />
<exclude name="PEAR.WhiteSpace.ScopeClosingBrace.Line" />
<exclude name="PEAR.WhiteSpace.ScopeIndent.Incorrect" />
<!-- We are using the PSR2 standard as a base -->
<rule ref="PSR2">
<!-- Exceptions for PHP4 compatibility -->
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
<exclude name="PSR2.Classes.PropertyDeclaration.ScopeMissing" />
<exclude name="PSR2.Classes.PropertyDeclaration.VarUsed" />
<exclude name="Squiz.Scope.MethodScope.Missing" />
<!-- Exceptions for backward compatibility -->
<exclude name="PSR1.Classes.ClassDeclaration.MultipleClasses" />
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<exclude name="PSR2.Methods.MethodDeclaration.Underscore" />
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
<!-- Exceptions for whitespacing -->
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonCASE" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonDEFAULT" />
<exclude name="PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket" />
<!-- Other Exceptions -->
<exclude name="Generic.Files.LineLength.TooLong" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.TerminatingComment" />
</rule>
<!-- Useful additional rules follow -->
@ -42,34 +37,4 @@
<!-- A method MUST not only call its parent -->
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
<!-- All code files MUST use only UTF-8 without BOM. -->
<rule ref="Generic.Files.ByteOrderMark" />
<!-- Each file MUST end with exactly one newline character -->
<rule ref="PSR2.Files.EndFileNewline" />
<!-- In the argument list, there MUST NOT be a space before each comma,
and there MUST be one space after each comma. -->
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
<property name="equalsSpacing" value="1"/>
</properties>
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" />
<!-- There MUST NOT be trailing whitespace at the end of lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
<!-- There MUST NOT be whitespace before the first content of a file -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
<!-- There MUST NOT be whitespace after the last content of a file -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
<!-- Functions MUST NOT contain multiple empty lines in a row -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
<!-- The ?> closing tag MUST be omitted from files containing only PHP. -->
<rule ref="Zend.Files.ClosingTag" />
</ruleset>