2015-09-27 14:10:11 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<ruleset name="drupal_core">
|
|
|
|
<description>Default PHP CodeSniffer configuration for Drupal core.</description>
|
|
|
|
<file>.</file>
|
2015-11-26 17:38:37 +00:00
|
|
|
<arg name="extensions" value="inc,install,module,php,profile,test,theme"/>
|
2015-09-27 14:10:11 +00:00
|
|
|
|
|
|
|
<!--Exclude third party code.-->
|
|
|
|
<exclude-pattern>./assets/vendor/*</exclude-pattern>
|
|
|
|
|
|
|
|
<!--Exclude test files that are intentionally empty, or intentionally violate coding standards.-->
|
|
|
|
<exclude-pattern>./modules/system/tests/fixtures/HtaccessTest</exclude-pattern>
|
|
|
|
|
2017-09-04 10:51:43 +00:00
|
|
|
<!-- Exclude third-party code maintained within core that does not follow our standards. -->
|
|
|
|
<!-- @todo This rule may be removed when https://www.drupal.org/node/1848264 is resolved. -->
|
|
|
|
<exclude-pattern>./core/lib/Drupal/Component/Diff/</exclude-pattern>
|
|
|
|
|
2016-02-25 04:14:55 +00:00
|
|
|
<!-- Only include specific sniffs that pass. This ensures that, if new sniffs are added, HEAD does not fail.-->
|
|
|
|
<!-- Drupal sniffs -->
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/ClassCreateInstanceSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/ClassDeclarationSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/FullyQualifiedNamespaceSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/UnusedUseStatementSniff.php"/>
|
2017-08-21 05:01:00 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/UseLeadingBackslashSniff.php"/>
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/CSS/ColourDefinitionSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/ClassCommentSniff.php">
|
2016-05-08 13:57:21 +00:00
|
|
|
<exclude name="Drupal.Commenting.ClassComment.Missing"/>
|
|
|
|
</rule>
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php">
|
2016-04-30 13:52:19 +00:00
|
|
|
<!-- Sniff for these errors: SpacingAfterTagGroup, WrongEnd, SpacingBetween,
|
2016-05-05 11:32:19 +00:00
|
|
|
ContentAfterOpen, SpacingBeforeShort, TagValueIndent, ShortStartSpace,
|
|
|
|
SpacingAfter -->
|
2016-04-30 13:52:19 +00:00
|
|
|
<exclude name="Drupal.Commenting.DocComment.LongNotCapital"/>
|
2016-05-05 11:32:19 +00:00
|
|
|
<!-- ParamNotFirst still not decided for PHPUnit-based tests.
|
|
|
|
@see https://www.drupal.org/node/2253915 -->
|
2016-04-30 13:52:19 +00:00
|
|
|
<exclude name="Drupal.Commenting.DocComment.ParamNotFirst"/>
|
|
|
|
<exclude name="Drupal.Commenting.DocComment.SpacingBeforeTags"/>
|
|
|
|
<exclude name="Drupal.Commenting.DocComment.LongFullStop"/>
|
|
|
|
<exclude name="Drupal.Commenting.DocComment.ShortNotCapital"/>
|
|
|
|
<exclude name="Drupal.Commenting.DocComment.ShortFullStop"/>
|
2016-05-05 11:32:19 +00:00
|
|
|
<!-- TagsNotGrouped and ParamGroup have false-positives.
|
|
|
|
@see https://www.drupal.org/node/2060925 -->
|
2016-04-30 13:52:19 +00:00
|
|
|
<exclude name="Drupal.Commenting.DocComment.TagsNotGrouped"/>
|
2016-05-05 11:32:19 +00:00
|
|
|
<exclude name="Drupal.Commenting.DocComment.ParamGroup"/>
|
2016-04-30 13:52:19 +00:00
|
|
|
<exclude name="Drupal.Commenting.DocComment.ShortSingleLine"/>
|
|
|
|
<exclude name="Drupal.Commenting.DocComment.TagGroupSpacing"/>
|
|
|
|
<exclude name="Drupal.Commenting.DocComment.MissingShort"/>
|
|
|
|
</rule>
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentStarSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/FileCommentSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php">
|
2016-04-29 08:53:52 +00:00
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.IncorrectTypeHint"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.InvalidNoReturn"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.InvalidReturnNotVoid"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.InvalidTypeHint"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.Missing"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.MissingFile"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.MissingParamComment"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.MissingParamType"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.MissingReturnComment"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.MissingReturnType"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.ParamCommentFullStop"/>
|
2017-03-04 15:04:49 +00:00
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.ParamCommentIndentation"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.ParamMissingDefinition"/>
|
2016-04-29 08:53:52 +00:00
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.ParamNameNoMatch"/>
|
|
|
|
<exclude name="Drupal.Commenting.FunctionComment.TypeHintMissing"/>
|
|
|
|
</rule>
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/ControlStructures/ElseIfSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/ControlStructures/ControlSignatureSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Files/EndFileNewlineSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Files/TxtFileLineLengthSniff.php"/>
|
2017-08-21 05:03:04 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Formatting/MultiLineAssignmentSniff.php"/>
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Formatting/SpaceInlineIfSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Formatting/SpaceUnaryOperatorSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Functions/DiscouragedFunctionsSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Functions/FunctionDeclarationSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/AutoAddedKeysSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/DuplicateEntrySniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/RequiredSniff.php"/>
|
2017-08-21 04:51:42 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidVariableNameSniff.php">
|
|
|
|
<!-- Sniff for: LowerStart -->
|
|
|
|
<exclude name="Drupal.NamingConventions.ValidVariableName.LowerCamelName"/>
|
|
|
|
</rule>
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Scope/MethodScopeSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/EmptyInstallSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/FunctionTSniff.php">
|
2016-04-29 09:05:19 +00:00
|
|
|
<exclude name="Drupal.Semantics.FunctionT.BackslashSingleQuote"/>
|
|
|
|
<exclude name="Drupal.Semantics.FunctionT.NotLiteralString"/>
|
|
|
|
<exclude name="Drupal.Semantics.FunctionT.ConcatString"/>
|
|
|
|
</rule>
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/FunctionWatchdogSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/InstallHooksSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/LStringTranslatableSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/PregSecuritySniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookMenuSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookSchemaSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/CommaSniff.php"/>
|
2017-08-21 05:04:51 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/EmptyLinesSniff.php"/>
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/OpenTagNewlineSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/OperatorSpacingSniff.php"/>
|
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php"/>
|
2016-02-25 04:14:55 +00:00
|
|
|
|
2017-03-27 10:26:01 +00:00
|
|
|
<!-- Drupal Practice sniffs -->
|
2017-04-11 12:20:07 +00:00
|
|
|
<rule ref="../vendor/drupal/coder/coder_sniffer/DrupalPractice/Sniffs/Commenting/ExpectedExceptionSniff.php"/>
|
2017-03-27 10:26:01 +00:00
|
|
|
|
2016-02-25 04:14:55 +00:00
|
|
|
<!-- Generic sniffs -->
|
|
|
|
<rule ref="Generic.Files.LineEndings"/>
|
2016-04-28 08:42:12 +00:00
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
|
2017-08-21 04:55:09 +00:00
|
|
|
<rule ref="Generic.NamingConventions.ConstructorName" />
|
2016-02-25 04:14:55 +00:00
|
|
|
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
|
|
|
|
<rule ref="Generic.PHP.DeprecatedFunctions"/>
|
|
|
|
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
|
2016-04-28 16:18:08 +00:00
|
|
|
<rule ref="Generic.PHP.UpperCaseConstant"/>
|
2016-02-25 04:14:55 +00:00
|
|
|
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
|
2017-03-04 01:20:24 +00:00
|
|
|
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
|
2016-02-25 04:14:55 +00:00
|
|
|
|
2016-05-05 11:21:09 +00:00
|
|
|
<!-- PSR-2 sniffs -->
|
|
|
|
<rule ref="PSR2.Classes.PropertyDeclaration">
|
|
|
|
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
|
|
|
|
</rule>
|
|
|
|
|
2016-05-05 11:07:19 +00:00
|
|
|
<!-- Squiz sniffs -->
|
|
|
|
<rule ref="Squiz.Strings.ConcatenationSpacing">
|
|
|
|
<properties>
|
|
|
|
<property name="spacing" value="1"/>
|
|
|
|
<property name="ignoreNewlines" value="true"/>
|
|
|
|
</properties>
|
|
|
|
</rule>
|
|
|
|
|
2015-09-27 14:10:11 +00:00
|
|
|
</ruleset>
|