|
1 | 1 | <?xml version="1.0"?> |
2 | | -<ruleset name="phpMyAdmin Standard" namespace="PMAStandard"> |
3 | | - <!-- https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> |
4 | | - <description>phpMyAdmin PHP_CodeSniffer custom coding standard</description> |
| 2 | +<ruleset |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | + name="phpMyAdmin" |
| 5 | + namespace="PMAStandard" |
| 6 | + xsi:noNamespaceSchemaLocation="../vendor/squizlabs/php_codesniffer/phpcs.xsd" |
| 7 | +> |
| 8 | + <description>The phpMyAdmin coding standard.</description> |
5 | 9 |
|
6 | 10 | <!-- The PSR-2 coding standard --> |
7 | | - <rule ref="PSR2" /> |
| 11 | + <rule ref="PSR2"/> |
8 | 12 |
|
9 | 13 | <!-- Short array syntax must be used to define arrays --> |
10 | | - <rule ref="Generic.Arrays.DisallowLongArraySyntax" /> |
| 14 | + <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> |
| 15 | + <!-- Ensures that array are indented with 4 spaces --> |
| 16 | + <rule ref="Generic.Arrays.ArrayIndent"/> |
11 | 17 |
|
12 | 18 | <!-- Functions should not have a nesting level greater than 10, and should try to stay below 5 --> |
13 | | - <rule ref="Generic.Metrics.NestingLevel" /> |
| 19 | + <rule ref="Generic.Metrics.NestingLevel"/> |
| 20 | + |
| 21 | + <!-- Control Structures must have at least one statement inside of the body --> |
| 22 | + <rule ref="Generic.CodeAnalysis.EmptyStatement"/> |
| 23 | + |
| 24 | + <!-- Ensures there is a single space after cast --> |
| 25 | + <rule ref="Generic.Formatting.SpaceAfterCast"/> |
| 26 | + <!-- Ensures there is a single space after a NOT operator --> |
| 27 | + <rule ref="Generic.Formatting.SpaceAfterNot"/> |
14 | 28 |
|
15 | 29 | <!-- Files, classes and functions must have a non-empty doc comment --> |
16 | 30 | <rule ref="PEAR.Commenting.ClassComment"> |
17 | | - <exclude name="PEAR.Commenting.ClassComment.MissingCategoryTag" /> |
18 | | - <exclude name="PEAR.Commenting.ClassComment.MissingAuthorTag" /> |
19 | | - <exclude name="PEAR.Commenting.ClassComment.MissingLicenseTag" /> |
20 | | - <exclude name="PEAR.Commenting.ClassComment.MissingLinkTag" /> |
| 31 | + <exclude name="PEAR.Commenting.ClassComment.MissingCategoryTag"/> |
| 32 | + <exclude name="PEAR.Commenting.ClassComment.MissingAuthorTag"/> |
| 33 | + <exclude name="PEAR.Commenting.ClassComment.MissingLicenseTag"/> |
| 34 | + <exclude name="PEAR.Commenting.ClassComment.MissingLinkTag"/> |
21 | 35 | </rule> |
22 | 36 | <rule ref="PEAR.Commenting.FileComment"> |
23 | | - <exclude name="PEAR.Commenting.FileComment.MissingCategoryTag" /> |
24 | | - <exclude name="PEAR.Commenting.FileComment.MissingAuthorTag" /> |
25 | | - <exclude name="PEAR.Commenting.FileComment.MissingLicenseTag" /> |
26 | | - <exclude name="PEAR.Commenting.FileComment.MissingLinkTag" /> |
27 | | - <exclude name="PEAR.Commenting.FileComment.MissingVersion" /> |
| 37 | + <exclude name="PEAR.Commenting.FileComment.MissingCategoryTag"/> |
| 38 | + <exclude name="PEAR.Commenting.FileComment.MissingAuthorTag"/> |
| 39 | + <exclude name="PEAR.Commenting.FileComment.MissingLicenseTag"/> |
| 40 | + <exclude name="PEAR.Commenting.FileComment.MissingLinkTag"/> |
| 41 | + <exclude name="PEAR.Commenting.FileComment.MissingVersion"/> |
28 | 42 | </rule> |
29 | | - <rule ref="PEAR.Commenting.FunctionComment" /> |
| 43 | + <rule ref="PEAR.Commenting.FunctionComment"/> |
| 44 | + <!-- Checks that no Perl-style # comments are used --> |
| 45 | + <rule ref="PEAR.Commenting.InlineComment"/> |
| 46 | + |
| 47 | + <!-- Ensure that there are no spaces around square brackets --> |
| 48 | + <rule ref="Squiz.Arrays.ArrayBracketSpacing"/> |
| 49 | + <!-- Ensures that arrays conform to the array coding standard --> |
| 50 | + <rule ref="Squiz.Arrays.ArrayDeclaration"> |
| 51 | + <exclude name="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned"/> |
| 52 | + <exclude name="Squiz.Arrays.ArrayDeclaration.KeyNotAligned"/> |
| 53 | + <exclude name="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed"/> |
| 54 | + <exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned"/> |
| 55 | + <exclude name="Squiz.Arrays.ArrayDeclaration.ValueNotAligned"/> |
| 56 | + </rule> |
| 57 | + |
| 58 | + <!-- Tests that the stars in a doc comment align correctly --> |
| 59 | + <rule ref="Squiz.Commenting.DocCommentAlignment"/> |
30 | 60 |
|
31 | 61 | <!-- Makes sure there is only one space before and after the concatenation operator --> |
32 | 62 | <rule ref="Squiz.Strings.ConcatenationSpacing"> |
33 | 63 | <properties> |
34 | | - <property name="spacing" value="1" /> |
35 | | - <property name="ignoreNewlines" value="true" /> |
| 64 | + <property name="spacing" value="1"/> |
| 65 | + <property name="ignoreNewlines" value="true"/> |
36 | 66 | </properties> |
37 | 67 | </rule> |
38 | 68 |
|
39 | 69 | <!-- Variable names should be camelCased with the first letter lowercase. --> |
40 | | - <rule ref="Zend.NamingConventions.ValidVariableName"> |
41 | | - <exclude name="Zend.NamingConventions.ValidVariableName.PrivateNoUnderscore" /> |
| 70 | + <rule ref="Squiz.NamingConventions.ValidVariableName"> |
| 71 | + <!-- Checked by PSR2 --> |
| 72 | + <exclude name="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore"/> |
| 73 | + <exclude name="Squiz.NamingConventions.ValidVariableName.PublicHasUnderscore"/> |
| 74 | + <type>warning</type> |
42 | 75 | </rule> |
43 | 76 | </ruleset> |
0 commit comments