-
Notifications
You must be signed in to change notification settings - Fork 17
/
phpcs.xml
54 lines (42 loc) · 2.31 KB
/
phpcs.xml
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
53
54
<?xml version="1.0"?>
<ruleset name="securityInfo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Matomo Coding Standard for SecurityInfo plugin</description>
<arg name="extensions" value="php" />
<file>.</file>
<exclude-pattern>tests/javascript/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<rule ref="Matomo"></rule>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="250" />
</properties>
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<!-- Classnames for our update files don't match PascalCase, this can't be changed easily -->
<exclude-pattern>Updates/*</exclude-pattern>
<!-- Allow classnames to be difference cases because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/*</exclude-pattern>
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<!-- Allow using method name without camel caps because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/Test/Test.php</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<!-- Allow using multiple classes in one file for tests -->
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<!-- Allow no namespace because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/PhpSecInfo.php</exclude-pattern>
<exclude-pattern>PhpSecInfo/Test/*</exclude-pattern>
</rule>
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<!-- Allow using method name with underscore prefix because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/*</exclude-pattern>
</rule>
<rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
<!-- Allow using property name with underscore prefix because we don't want to have to refactor and risk regressions -->
<exclude-pattern>PhpSecInfo/*</exclude-pattern>
</rule>
</ruleset>