|
6 | 6 |
|
7 | 7 | <!-- Only include specific sniffs that pass. This ensures that, if new sniffs are added, HEAD does not fail.-->
|
8 | 8 | <!-- Drupal sniffs -->
|
| 9 | + <rule ref="Drupal.Array.DisallowLongArraySyntax"/> |
9 | 10 | <rule ref="Drupal.Classes.ClassCreateInstance"/>
|
10 | 11 | <rule ref="Drupal.Classes.ClassDeclaration"/>
|
11 | 12 | <rule ref="Drupal.Classes.FullyQualifiedNamespace"/>
|
| 13 | + <rule ref="Drupal.Classes.InterfaceName"/> |
12 | 14 | <rule ref="Drupal.Classes.UnusedUseStatement"/>
|
13 | 15 | <rule ref="Drupal.Classes.UseLeadingBackslash"/>
|
14 | 16 | <rule ref="Drupal.CSS.ClassDefinitionNameSpacing"/>
|
15 | 17 | <rule ref="Drupal.CSS.ColourDefinition"/>
|
16 | 18 | <rule ref="Drupal.Commenting.ClassComment"/>
|
| 19 | + <rule ref="Drupal.Commenting.DataTypeNamespace" /> |
17 | 20 | <rule ref="Drupal.Commenting.DocComment"/>
|
18 | 21 | <rule ref="Drupal.Commenting.DocCommentStar"/>
|
19 | 22 | <rule ref="Drupal.Commenting.FileComment"/>
|
20 | 23 | <rule ref="Drupal.Commenting.FunctionComment"/>
|
| 24 | + <rule ref="Drupal.Commenting.InlineComment"> |
| 25 | + <!-- This is impractical when commenting code out. --> |
| 26 | + <exclude name="Drupal.Commenting.InlineComment.InvalidEndChar" /> |
| 27 | + <!-- We (rarely) use comments as "headings" for multiple functions. --> |
| 28 | + <exclude name="Drupal.Commenting.InlineComment.SpacingAfter" /> |
| 29 | + <!-- |
| 30 | + This disallows indentation in comments, even though it can sometimes be |
| 31 | + helpful for structured explanations. |
| 32 | +
|
| 33 | + @see \Drupal\search_api\Plugin\search_api\processor\ContentAccess::addNodeAccess() |
| 34 | + --> |
| 35 | + <exclude name="Drupal.Commenting.InlineComment.SpacingBefore" /> |
| 36 | + </rule> |
| 37 | + <rule ref="Drupal.Commenting.VariableComment"> |
| 38 | + <!-- This finds false positives when @code is used. --> |
| 39 | + <exclude name="Drupal.Commenting.VariableComment.VarOrder"/> |
| 40 | + </rule> |
| 41 | + <rule ref="Drupal.Commenting.PostStatementComment"/> |
21 | 42 | <rule ref="Drupal.ControlStructures.ElseIf"/>
|
22 | 43 | <rule ref="Drupal.ControlStructures.ControlSignature"/>
|
| 44 | + <rule ref="Drupal.ControlStructures.InlineControlStructure"/> |
23 | 45 | <rule ref="Drupal.Files.EndFileNewline"/>
|
| 46 | + <rule ref="Drupal.Files.FileEncoding"/> |
24 | 47 | <rule ref="Drupal.Files.TxtFileLineLength"/>
|
25 | 48 | <rule ref="Drupal.Formatting.MultiLineAssignment"/>
|
26 | 49 | <rule ref="Drupal.Formatting.SpaceInlineIf"/>
|
|
31 | 54 | <rule ref="Drupal.InfoFiles.ClassFiles"/>
|
32 | 55 | <rule ref="Drupal.InfoFiles.DuplicateEntry"/>
|
33 | 56 | <rule ref="Drupal.InfoFiles.Required"/>
|
| 57 | + <rule ref="Drupal.Methods.MethodDeclaration"/> |
34 | 58 | <rule ref="Drupal.NamingConventions.ValidVariableName">
|
35 |
| - <!-- Sniff for: LowerStart --> |
| 59 | + <!-- This interferes with the stored entity properties. --> |
36 | 60 | <exclude name="Drupal.NamingConventions.ValidVariableName.LowerCamelName"/>
|
37 | 61 | </rule>
|
38 | 62 | <rule ref="Drupal.Scope.MethodScope"/>
|
39 | 63 | <rule ref="Drupal.Semantics.EmptyInstall"/>
|
| 64 | + <rule ref="Drupal.Semantics.FunctionAlias"/> |
40 | 65 | <rule ref="Drupal.Semantics.FunctionT"/>
|
41 | 66 | <rule ref="Drupal.Semantics.FunctionWatchdog"/>
|
42 | 67 | <rule ref="Drupal.Semantics.InstallHooks"/>
|
43 | 68 | <rule ref="Drupal.Semantics.LStringTranslatable"/>
|
44 | 69 | <rule ref="Drupal.Semantics.PregSecurity"/>
|
45 | 70 | <rule ref="Drupal.Semantics.TInHookMenu"/>
|
46 | 71 | <rule ref="Drupal.Semantics.TInHookSchema"/>
|
| 72 | + <rule ref="Drupal.WhiteSpace.CloseBracketSpacing"/> |
47 | 73 | <rule ref="Drupal.WhiteSpace.Comma"/>
|
48 | 74 | <rule ref="Drupal.WhiteSpace.EmptyLines"/>
|
| 75 | + <rule ref="Drupal.WhiteSpace.Namespace"/> |
49 | 76 | <rule ref="Drupal.WhiteSpace.ObjectOperatorIndent"/>
|
50 | 77 | <rule ref="Drupal.WhiteSpace.ObjectOperatorSpacing"/>
|
| 78 | + <rule ref="Drupal.WhiteSpace.OpenBracketSpacing"/> |
51 | 79 | <rule ref="Drupal.WhiteSpace.OpenTagNewline"/>
|
52 | 80 | <rule ref="Drupal.WhiteSpace.OperatorSpacing"/>
|
| 81 | + <rule ref="Drupal.WhiteSpace.ScopeClosingBrace"/> |
53 | 82 | <rule ref="Drupal.WhiteSpace.ScopeIndent"/>
|
54 | 83 |
|
55 | 84 | <!-- Drupal Practice sniffs -->
|
56 | 85 | <rule ref="DrupalPractice.Commenting.ExpectedException"/>
|
57 | 86 |
|
58 | 87 | <!-- Generic sniffs -->
|
| 88 | + <rule ref="Generic.Files.ByteOrderMark"/> |
59 | 89 | <rule ref="Generic.Files.LineEndings"/>
|
| 90 | + <rule ref="Generic.Formatting.SpaceAfterCast"/> |
60 | 91 | <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
|
61 |
| - <rule ref="Generic.NamingConventions.ConstructorName" /> |
| 92 | + <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"> |
| 93 | + <properties> |
| 94 | + <property name="checkClosures" value="true"/> |
| 95 | + </properties> |
| 96 | + </rule> |
| 97 | + <rule ref="Generic.NamingConventions.ConstructorName"/> |
62 | 98 | <rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
|
63 | 99 | <rule ref="Generic.PHP.DeprecatedFunctions"/>
|
64 | 100 | <rule ref="Generic.PHP.DisallowShortOpenTag"/>
|
| 101 | + <rule ref="Generic.PHP.LowerCaseKeyword"/> |
65 | 102 | <rule ref="Generic.PHP.UpperCaseConstant"/>
|
66 | 103 | <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
|
67 |
| - <rule ref="Generic.Arrays.DisallowLongArraySyntax" /> |
| 104 | + |
| 105 | + <!-- MySource sniffs --> |
| 106 | + <rule ref="MySource.Debug.DebugCode"/> |
| 107 | + |
| 108 | + <!-- PEAR sniffs --> |
| 109 | + <rule ref="PEAR.Files.IncludingFile"/> |
| 110 | + <!-- Disable some error messages that we do not want. --> |
| 111 | + <rule ref="PEAR.Files.IncludingFile.UseIncludeOnce"> |
| 112 | + <severity>0</severity> |
| 113 | + </rule> |
| 114 | + <rule ref="PEAR.Files.IncludingFile.UseInclude"> |
| 115 | + <severity>0</severity> |
| 116 | + </rule> |
| 117 | + <rule ref="PEAR.Files.IncludingFile.UseRequireOnce"> |
| 118 | + <severity>0</severity> |
| 119 | + </rule> |
| 120 | + <rule ref="PEAR.Files.IncludingFile.UseRequire"> |
| 121 | + <severity>0</severity> |
| 122 | + </rule> |
| 123 | + <rule ref="PEAR.Functions.ValidDefaultValue"/> |
| 124 | + |
| 125 | + <!-- PEAR sniffs --> |
| 126 | + <rule ref="PEAR.Functions.FunctionCallSignature"/> |
| 127 | + <!-- The sniffs inside PEAR.Functions.FunctionCallSignature silenced below are |
| 128 | + also silenced in Drupal CS' ruleset.xml. The code below is a 1-on-1 copy |
| 129 | + from that file. --> |
| 130 | + <!-- Disable some error messages that we already cover. --> |
| 131 | + <rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket"> |
| 132 | + <severity>0</severity> |
| 133 | + </rule> |
| 134 | + <rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket"> |
| 135 | + <severity>0</severity> |
| 136 | + </rule> |
| 137 | + <!-- Disable some error messages that we do not want. --> |
| 138 | + <rule ref="PEAR.Functions.FunctionCallSignature.Indent"> |
| 139 | + <severity>0</severity> |
| 140 | + </rule> |
| 141 | + <rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"> |
| 142 | + <severity>0</severity> |
| 143 | + </rule> |
| 144 | + <rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine"> |
| 145 | + <severity>0</severity> |
| 146 | + </rule> |
| 147 | + <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine"> |
| 148 | + <severity>0</severity> |
| 149 | + </rule> |
68 | 150 |
|
69 | 151 | <!-- PSR-2 sniffs -->
|
70 | 152 | <rule ref="PSR2.Classes.PropertyDeclaration"/>
|
| 153 | + <rule ref="PSR2.Namespaces.NamespaceDeclaration"/> |
| 154 | + <rule ref="PSR2.Namespaces.UseDeclaration"/> |
71 | 155 |
|
72 | 156 | <!-- Squiz sniffs -->
|
| 157 | + <rule ref="Squiz.Arrays.ArrayBracketSpacing"/> |
| 158 | + <rule ref="Squiz.Arrays.ArrayDeclaration"> |
| 159 | + <exclude name="Squiz.Arrays.ArrayDeclaration.NoKeySpecified"/> |
| 160 | + <exclude name="Squiz.Arrays.ArrayDeclaration.KeySpecified"/> |
| 161 | + </rule> |
| 162 | + <!-- Disable some error messages that we do not want. --> |
| 163 | + <rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned"> |
| 164 | + <severity>0</severity> |
| 165 | + </rule> |
| 166 | + <rule ref="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned"> |
| 167 | + <severity>0</severity> |
| 168 | + </rule> |
| 169 | + <rule ref="Squiz.Arrays.ArrayDeclaration.FirstValueNoNewline"> |
| 170 | + <severity>0</severity> |
| 171 | + </rule> |
| 172 | + <rule ref="Squiz.Arrays.ArrayDeclaration.KeyNotAligned"> |
| 173 | + <severity>0</severity> |
| 174 | + </rule> |
| 175 | + <rule ref="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed"> |
| 176 | + <severity>0</severity> |
| 177 | + </rule> |
| 178 | + <rule ref="Squiz.Arrays.ArrayDeclaration.NoComma"> |
| 179 | + <severity>0</severity> |
| 180 | + </rule> |
| 181 | + <rule ref="Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast"> |
| 182 | + <severity>0</severity> |
| 183 | + </rule> |
| 184 | + <rule ref="Squiz.Arrays.ArrayDeclaration.NotLowerCase"> |
| 185 | + <severity>0</severity> |
| 186 | + </rule> |
| 187 | + <rule ref="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed"> |
| 188 | + <severity>0</severity> |
| 189 | + </rule> |
| 190 | + <rule ref="Squiz.Arrays.ArrayDeclaration.ValueNotAligned"> |
| 191 | + <severity>0</severity> |
| 192 | + </rule> |
| 193 | + <rule ref="Squiz.Arrays.ArrayDeclaration.ValueNoNewline"> |
| 194 | + <severity>0</severity> |
| 195 | + </rule> |
| 196 | + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/> |
| 197 | + <!-- Disable some error messages that we already cover. --> |
| 198 | + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.AsNotLower"> |
| 199 | + <severity>0</severity> |
| 200 | + </rule> |
| 201 | + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen"> |
| 202 | + <severity>0</severity> |
| 203 | + </rule> |
| 204 | + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose"> |
| 205 | + <severity>0</severity> |
| 206 | + </rule> |
| 207 | + <rule ref="Squiz.ControlStructures.ForLoopDeclaration"/> |
| 208 | + <!-- Disable some error messages that we already cover. --> |
| 209 | + <rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterOpen"> |
| 210 | + <severity>0</severity> |
| 211 | + </rule> |
| 212 | + <rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingBeforeClose"> |
| 213 | + <severity>0</severity> |
| 214 | + </rule> |
| 215 | + <rule ref="Squiz.Functions.MultiLineFunctionDeclaration"/> |
| 216 | + <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"> |
| 217 | + <severity>0</severity> |
| 218 | + </rule> |
| 219 | + <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace"> |
| 220 | + <severity>0</severity> |
| 221 | + </rule> |
| 222 | + <!-- Standard yet to be finalized on this (https://www.drupal.org/node/1539712). --> |
| 223 | + <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.FirstParamSpacing"> |
| 224 | + <severity>0</severity> |
| 225 | + </rule> |
| 226 | + <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.Indent"> |
| 227 | + <severity>0</severity> |
| 228 | + </rule> |
| 229 | + <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.CloseBracketLine"> |
| 230 | + <severity>0</severity> |
| 231 | + </rule> |
| 232 | + <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> |
| 233 | + <properties> |
| 234 | + <property name="equalsSpacing" value="1"/> |
| 235 | + </properties> |
| 236 | + </rule> |
| 237 | + <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.NoSpaceBeforeArg"> |
| 238 | + <severity>0</severity> |
| 239 | + </rule> |
| 240 | + <rule ref="Squiz.PHP.LowercasePHPFunctions"/> |
73 | 241 | <rule ref="Squiz.Strings.ConcatenationSpacing">
|
74 | 242 | <properties>
|
75 | 243 | <property name="spacing" value="1"/>
|
76 | 244 | <property name="ignoreNewlines" value="true"/>
|
77 | 245 | </properties>
|
78 |
| - </rule> |
| 246 | + </rule> |
| 247 | + <rule ref="Squiz.WhiteSpace.LanguageConstructSpacing" /> |
| 248 | + <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/> |
| 249 | + <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/> |
| 250 | + |
| 251 | + <!-- Zend sniffs --> |
| 252 | + <rule ref="Zend.Files.ClosingTag"/> |
79 | 253 |
|
80 | 254 | </ruleset>
|
0 commit comments