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