diff vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 129ea1e6d783
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,287 @@
+<?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>