annotate vendor/squizlabs/php_codesniffer/phpcs.xml.dist @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
rev   line source
Chris@0 1 <?xml version="1.0"?>
Chris@4 2 <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
Chris@4 3 <description>The coding standard for PHP_CodeSniffer itself.</description>
Chris@0 4
Chris@4 5 <file>autoload.php</file>
Chris@4 6 <file>bin</file>
Chris@4 7 <file>scripts</file>
Chris@4 8 <file>src</file>
Chris@4 9 <file>tests</file>
Chris@0 10
Chris@5 11 <exclude-pattern>*/src/Standards/*/Tests/*\.(inc|css|js)$</exclude-pattern>
Chris@5 12 <exclude-pattern>*/tests/Core/*/*Test\.(inc|css|js)$</exclude-pattern>
Chris@0 13
Chris@4 14 <arg name="basepath" value="."/>
Chris@4 15 <arg name="colors"/>
Chris@4 16 <arg name="parallel" value="75"/>
Chris@4 17 <arg value="np"/>
Chris@0 18
Chris@4 19 <!-- Don't hide tokenizer exceptions -->
Chris@4 20 <rule ref="Internal.Tokenizer.Exception">
Chris@4 21 <type>error</type>
Chris@4 22 </rule>
Chris@4 23
Chris@4 24 <!-- Include the whole PEAR standard -->
Chris@4 25 <rule ref="PEAR">
Chris@4 26 <exclude name="PEAR.NamingConventions.ValidFunctionName"/>
Chris@4 27 <exclude name="PEAR.NamingConventions.ValidVariableName"/>
Chris@4 28 <exclude name="PEAR.Commenting.ClassComment"/>
Chris@4 29 <exclude name="PEAR.Commenting.FileComment.MissingCategoryTag"/>
Chris@4 30 <exclude name="PEAR.Commenting.FileComment.MissingPackageTag"/>
Chris@4 31 <exclude name="PEAR.Commenting.FileComment.MissingLinkTag"/>
Chris@4 32 <exclude name="PEAR.Commenting.FileComment.MissingVersion"/>
Chris@4 33 <exclude name="PEAR.Commenting.InlineComment"/>
Chris@4 34 </rule>
Chris@4 35
Chris@4 36 <!-- Include some sniffs from other standards that don't conflict with PEAR -->
Chris@4 37 <rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
Chris@4 38 <rule ref="Squiz.Arrays.ArrayDeclaration"/>
Chris@4 39 <rule ref="Squiz.Commenting.ClosingDeclarationComment"/>
Chris@4 40 <rule ref="Squiz.ControlStructures.ControlSignature"/>
Chris@4 41 <rule ref="Squiz.ControlStructures.ElseIfDeclaration"/>
Chris@4 42 <rule ref="Squiz.Commenting.BlockComment"/>
Chris@4 43 <rule ref="Squiz.Commenting.DocCommentAlignment"/>
Chris@4 44 <rule ref="Squiz.Commenting.EmptyCatchComment"/>
Chris@4 45 <rule ref="Squiz.Commenting.InlineComment"/>
Chris@4 46 <rule ref="Squiz.Commenting.LongConditionClosingComment"/>
Chris@4 47 <rule ref="Squiz.Commenting.PostStatementComment"/>
Chris@4 48 <rule ref="Squiz.Commenting.VariableComment"/>
Chris@4 49 <rule ref="Squiz.Formatting.OperatorBracket"/>
Chris@4 50 <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"/>
Chris@4 51 <rule ref="Squiz.Operators.ComparisonOperatorUsage"/>
Chris@4 52 <rule ref="Squiz.PHP.DisallowInlineIf"/>
Chris@4 53 <rule ref="Squiz.Scope.MethodScope"/>
Chris@4 54 <rule ref="Squiz.Strings.ConcatenationSpacing"/>
Chris@4 55 <rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>
Chris@4 56 <rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/>
Chris@4 57 <rule ref="Squiz.WhiteSpace.FunctionSpacing"/>
Chris@4 58 <rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
Chris@4 59 <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
Chris@4 60 <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
Chris@4 61 <rule ref="Generic.Commenting.Todo"/>
Chris@4 62 <rule ref="Generic.ControlStructures.InlineControlStructure"/>
Chris@4 63 <rule ref="Generic.Formatting.DisallowMultipleStatements"/>
Chris@4 64 <rule ref="Generic.Formatting.SpaceAfterCast"/>
Chris@4 65 <rule ref="Generic.NamingConventions.ConstructorName"/>
Chris@4 66 <rule ref="Generic.PHP.DeprecatedFunctions"/>
Chris@4 67 <rule ref="Generic.PHP.LowerCaseKeyword"/>
Chris@4 68 <rule ref="Generic.Strings.UnnecessaryStringConcat"/>
Chris@4 69 <rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/>
Chris@4 70 <rule ref="PSR2.Classes.PropertyDeclaration"/>
Chris@4 71 <rule ref="PSR2.Methods.MethodDeclaration"/>
Chris@4 72 <rule ref="PSR2.Files.EndFileNewline"/>
Chris@4 73 <rule ref="Zend.Files.ClosingTag"/>
Chris@4 74
Chris@4 75 <!-- PEAR uses warnings for inline control structures, so switch back to errors -->
Chris@4 76 <rule ref="Generic.ControlStructures.InlineControlStructure">
Chris@4 77 <properties>
Chris@4 78 <property name="error" value="true"/>
Chris@4 79 </properties>
Chris@4 80 </rule>
Chris@4 81
Chris@4 82 <!-- We use custom indent rules for arrays -->
Chris@4 83 <rule ref="Generic.Arrays.ArrayIndent"/>
Chris@4 84 <rule ref="Squiz.Arrays.ArrayDeclaration.KeyNotAligned">
Chris@4 85 <severity>0</severity>
Chris@4 86 </rule>
Chris@4 87 <rule ref="Squiz.Arrays.ArrayDeclaration.ValueNotAligned">
Chris@4 88 <severity>0</severity>
Chris@4 89 </rule>
Chris@4 90 <rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned">
Chris@4 91 <severity>0</severity>
Chris@4 92 </rule>
Chris@4 93 <rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNewLine">
Chris@4 94 <severity>0</severity>
Chris@4 95 </rule>
Chris@4 96
Chris@4 97 <!-- Check var names, but we don't want leading underscores for private vars -->
Chris@4 98 <rule ref="Squiz.NamingConventions.ValidVariableName"/>
Chris@4 99 <rule ref="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore">
Chris@4 100 <severity>0</severity>
Chris@4 101 </rule>
Chris@4 102
Chris@4 103 <!-- Only one argument per line in multi-line function calls -->
Chris@4 104 <rule ref="PEAR.Functions.FunctionCallSignature">
Chris@4 105 <properties>
Chris@4 106 <property name="allowMultipleArguments" value="false"/>
Chris@4 107 </properties>
Chris@4 108 </rule>
Chris@4 109
Chris@4 110 <!-- Have 12 chars padding maximum and always show as errors -->
Chris@4 111 <rule ref="Generic.Formatting.MultipleStatementAlignment">
Chris@4 112 <properties>
Chris@4 113 <property name="maxPadding" value="12"/>
Chris@4 114 <property name="error" value="true"/>
Chris@4 115 </properties>
Chris@4 116 </rule>
Chris@4 117
Chris@4 118 <!-- Ban some functions -->
Chris@4 119 <rule ref="Generic.PHP.ForbiddenFunctions">
Chris@4 120 <properties>
Chris@4 121 <property name="forbiddenFunctions" type="array">
Chris@4 122 <element key="sizeof" value="count"/>
Chris@4 123 <element key="delete" value="unset"/>
Chris@4 124 <element key="print" value="echo"/>
Chris@4 125 <element key="is_null" value="null"/>
Chris@4 126 <element key="create_function" value="null"/>
Chris@4 127 </property>
Chris@4 128 </properties>
Chris@4 129 </rule>
Chris@4 130
Chris@4 131 <!-- Private methods MUST not be prefixed with an underscore -->
Chris@4 132 <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
Chris@4 133 <type>error</type>
Chris@4 134 </rule>
Chris@4 135
Chris@4 136 <!-- Private properties MUST not be prefixed with an underscore -->
Chris@4 137 <rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
Chris@4 138 <type>error</type>
Chris@4 139 </rule>
Chris@4 140
Chris@4 141 <!-- The testing bootstrap file uses string concats to stop IDEs seeing the class aliases -->
Chris@4 142 <rule ref="Generic.Strings.UnnecessaryStringConcat">
Chris@4 143 <exclude-pattern>tests/bootstrap.php</exclude-pattern>
Chris@4 144 </rule>
Chris@4 145
Chris@0 146 </ruleset>