|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | + |
| 3 | +<!-- https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset --> |
| 4 | +<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 5 | + name="PhpTuf" |
| 6 | + xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd" |
| 7 | +> |
| 8 | + |
| 9 | + <description>PHP TUF Composer Integration</description> |
| 10 | + |
| 11 | + <arg name="colors"/> |
| 12 | + <arg name="parallel" value="10"/> |
| 13 | + |
| 14 | + <file>src</file> |
| 15 | + <file>tests</file> |
| 16 | + |
| 17 | + <!-- We basically follow PSR-2 --> |
| 18 | + <rule ref="PSR2"> |
| 19 | + <exclude name="Generic.Files.LineLength.TooLong"/> |
| 20 | + </rule> |
| 21 | + |
| 22 | + <!-- Since PSR-2 / PSR-12 say nothing about variable lettercase, we choose a standard. --> |
| 23 | + <rule ref="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/> |
| 24 | + <rule ref="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps"/> |
| 25 | + <rule ref="Squiz.NamingConventions.ValidVariableName.StringNotCamelCaps"/> |
| 26 | + |
| 27 | + <!-- PSR-2 doesn't enforce commenting standards. |
| 28 | + https://github.com/squizlabs/PHP_CodeSniffer/issues/2314#issuecomment-448008052 |
| 29 | + https://www.php-fig.org/psr/psr-2/#7-conclusion |
| 30 | + Add PEAR's rule to make sure comment indentation matches code. |
| 31 | + @todo - breaks on switch statements. |
| 32 | + @see https://github.com/php-tuf/php-tuf/issues/58 |
| 33 | + <rule ref="PEAR.WhiteSpace"/> |
| 34 | + --> |
| 35 | + |
| 36 | + <!-- Specify array formatting --> |
| 37 | + <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> |
| 38 | + <rule ref="Generic.Arrays.ArrayIndent"/> |
| 39 | + <rule ref="Squiz.Arrays.ArrayBracketSpacing"/> |
| 40 | + <rule ref="Squiz.Arrays.ArrayDeclaration"> |
| 41 | + <!-- Disable some child rules that cause incorrect formatting. --> |
| 42 | + <exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned"/> |
| 43 | + <exclude name="Squiz.Arrays.ArrayDeclaration.ValueNotAligned"/> |
| 44 | + <exclude name="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed"/> |
| 45 | + <exclude name="Squiz.Arrays.ArrayDeclaration.KeyNotAligned"/> |
| 46 | + <exclude name="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned"/> |
| 47 | + </rule> |
| 48 | + |
| 49 | + <!-- Find unused code --> |
| 50 | + <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/> |
| 51 | + |
| 52 | +</ruleset> |
0 commit comments