123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <?xml version="1.0"?>
- <!-- See http://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php -->
- <ruleset name="Drupal">
- <description>Drupal coding standard</description>
- <!-- All Drupal code files must be UTF-8 encoded and we treat them as such. -->
- <arg name="encoding" value="utf-8"/>
- <arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,md,yml"/>
- <rule ref="Internal.NoCodeFound">
- <!-- Empty files are fine, might be used for testing. -->
- <exclude-pattern>*</exclude-pattern>
- </rule>
- <rule ref="Drupal.Commenting.FileComment">
- <!-- Do not run this sniff on txt files. -->
- <exclude-pattern>*.txt</exclude-pattern>
- </rule>
- <rule ref="Drupal.Commenting.FileComment.SpacingAfterComment">
- <!-- Do not run this sniff on template files. -->
- <exclude-pattern>*.tpl.php</exclude-pattern>
- </rule>
- <rule ref="Drupal.ControlStructures.ControlSignature">
- <!-- Do not run this sniff on template files. -->
- <exclude-pattern>*.tpl.php</exclude-pattern>
- </rule>
- <!-- Silence deprecated sniff that will be removed in Coder 9.x. -->
- <rule ref="Drupal.Functions.FunctionDeclaration.SpaceAfter">
- <severity>0</severity>
- </rule>
- <rule ref="Drupal.Functions.FunctionDeclaration.SpaceBeforeParenthesis">
- <severity>0</severity>
- </rule>
- <!-- Silence mmethod name underscore warning which is coverd already in
- Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps. -->
- <rule ref="Drupal.Methods.MethodDeclaration.Underscore">
- <severity>0</severity>
- </rule>
- <rule ref="Drupal.WhiteSpace.ScopeIndent">
- <!-- Do not run this sniff on template files, as the indentation might follow
- the HTML -->
- <exclude-pattern>*.tpl.php</exclude-pattern>
- </rule>
- <rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
- <rule ref="Generic.Files.ByteOrderMark" />
- <rule ref="Generic.Formatting.SpaceAfterCast" />
- <rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
- <rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma">
- <severity>0</severity>
- </rule>
- <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie">
- <properties>
- <property name="checkClosures" value="true"/>
- </properties>
- </rule>
- <rule ref="Generic.NamingConventions.ConstructorName" />
- <rule ref="Generic.NamingConventions.UpperCaseConstantName" />
- <rule ref="Generic.PHP.DeprecatedFunctions" />
- <rule ref="Generic.PHP.DisallowShortOpenTag" />
- <rule ref="Generic.PHP.LowerCaseKeyword" />
- <rule ref="Generic.PHP.UpperCaseConstant" />
- <rule ref="Generic.WhiteSpace.DisallowTabIndent" />
- <!-- Use Unix newlines -->
- <rule ref="Generic.Files.LineEndings">
- <properties>
- <property name="eolChar" value="\n"/>
- </properties>
- </rule>
- <rule ref="MySource.Debug.DebugCode" />
- <rule ref="PEAR.Files.IncludingFile" />
- <!-- Disable some error messages that we do not want. -->
- <rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
- <severity>0</severity>
- </rule>
- <rule ref="PEAR.Files.IncludingFile.UseInclude">
- <severity>0</severity>
- </rule>
- <rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
- <severity>0</severity>
- </rule>
- <rule ref="PEAR.Files.IncludingFile.UseRequire">
- <severity>0</severity>
- </rule>
- <rule ref="PEAR.Functions.FunctionCallSignature"/>
- <!-- Disable some error messages that we already cover. -->
- <rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket">
- <severity>0</severity>
- </rule>
- <rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket">
- <severity>0</severity>
- </rule>
- <!-- Disable some error messages that we do not want. -->
- <rule ref="PEAR.Functions.FunctionCallSignature.Indent">
- <severity>0</severity>
- </rule>
- <rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
- <severity>0</severity>
- </rule>
- <rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
- <severity>0</severity>
- </rule>
- <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
- <severity>0</severity>
- </rule>
- <rule ref="PEAR.Functions.ValidDefaultValue" />
- <rule ref="PSR2.Namespaces.NamespaceDeclaration" />
- <rule ref="PSR2.Namespaces.UseDeclaration" />
- <rule ref="Squiz.Arrays.ArrayDeclaration" />
- <!-- Disable some error messages that we do not want. -->
- <rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.FirstValueNoNewline">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.KeyNotAligned">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.NoComma">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.NotLowerCase">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.ValueNotAligned">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayDeclaration.ValueNoNewline">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Arrays.ArrayBracketSpacing" />
- <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration" />
- <!-- Disable some error messages that we already cover. -->
- <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.AsNotLower">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.ForLoopDeclaration" />
- <!-- Disable some error messages that we already cover. -->
- <rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterOpen">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingBeforeClose">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration" />
- <!-- Disable some error messages that we do not want. -->
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.BreakIndent">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.CaseIndent">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.CloseBraceAlign">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.DefaultIndent">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.DefaultNoBreak">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.EmptyCase">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.EmptyDefault">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.MissingDefault">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.SpacingAfterCase">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.SpacingAfterDefaultBreak">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.ControlStructures.SwitchDeclaration.SpacingBeforeBreak">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.CSS.ClassDefinitionClosingBraceSpace" />
- <rule ref="Squiz.CSS.ClassDefinitionClosingBraceSpace.SpacingAfterClose">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.CSS.ClassDefinitionOpeningBraceSpace" />
- <rule ref="Squiz.CSS.ClassDefinitionOpeningBraceSpace.AfterNesting">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.CSS.ColonSpacing" />
- <rule ref="Squiz.CSS.DisallowMultipleStyleDefinitions" />
- <rule ref="Squiz.CSS.EmptyClassDefinition" />
- <rule ref="Squiz.CSS.EmptyStyleDefinition" />
- <rule ref="Squiz.CSS.Indentation">
- <properties>
- <property name="indent" value="2"/>
- </properties>
- </rule>
- <rule ref="Squiz.CSS.MissingColon" />
- <rule ref="Squiz.CSS.SemicolonSpacing" />
- <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
- <properties>
- <property name="equalsSpacing" value="1"/>
- </properties>
- </rule>
- <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.NoSpaceBeforeArg">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
- <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace">
- <severity>0</severity>
- </rule>
- <!-- Standard yet to be finalized on this (https://www.drupal.org/node/1539712). -->
- <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.FirstParamSpacing">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.Indent">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.CloseBracketLine">
- <severity>0</severity>
- </rule>
- <rule ref="Squiz.PHP.LowercasePHPFunctions" />
- <rule ref="Squiz.PHP.NonExecutableCode" />
- <rule ref="Squiz.Strings.ConcatenationSpacing">
- <properties>
- <property name="spacing" value="1"/>
- <property name="ignoreNewlines" value="true"/>
- </properties>
- </rule>
- <rule ref="Squiz.WhiteSpace.FunctionSpacing">
- <properties>
- <property name="spacing" value="1"/>
- </properties>
- </rule>
- <rule ref="Squiz.WhiteSpace.LanguageConstructSpacing" />
- <rule ref="Squiz.WhiteSpace.SemicolonSpacing" />
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
- <rule ref="Zend.Files.ClosingTag">
- <!-- Do not run this sniff on template files. -->
- <exclude-pattern>*.tpl.php</exclude-pattern>
- </rule>
- <!-- Ignore various version control directories. -->
- <exclude-pattern>*/\.git/*</exclude-pattern>
- <exclude-pattern>*/\.svn/*</exclude-pattern>
- <exclude-pattern>*/\.hg/*</exclude-pattern>
- <exclude-pattern>*/\.bzr/*</exclude-pattern>
- </ruleset>
|