-
Notifications
You must be signed in to change notification settings - Fork 25
/
.phpcs.xml.dist
74 lines (58 loc) · 3.12 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0"?>
<ruleset name="Coding Standard for the AMP Toolbox PHP Library">
<!-- Use PSR-12 as baseline standard -->
<rule ref="PSR12">
<!-- We cannot use constant visibility because of PHP 5.6 compat -->
<exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
</rule>
<arg value="p"/>
<arg value="s"/>
<arg name="extensions" value="php"/>
<!-- Include only the directories containing PHP files. -->
<file>bin/</file>
<file>include/</file>
<file>src/</file>
<file>tests/</file>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="1"/>
<!-- Executable scripts are meant to have side-effects. -->
<rule ref="PSR1.Files.SideEffects">
<exclude-pattern>bin/*</exclude-pattern>
</rule>
<!-- Line length can not easily be controlled in generated code. -->
<rule ref="Generic.Files.LineLength.TooLong">
<exclude-pattern>src/Validator/ErrorCode.php</exclude-pattern>
<exclude-pattern>src/Validator/Spec.php</exclude-pattern>
<exclude-pattern>src/Validator/Spec/*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!-- Class names that conflict with PHP reserved keywords need to be suffixed. -->
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<exclude-pattern>src/Validator/Spec/Tag/*_.php</exclude-pattern>
</rule>
<!-- Method names for overrides need to stick with their signature independently of the standard. -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>tests/Validator/Spec/Section/*.php</exclude-pattern>
</rule>
<!-- WordPress Coding Standards for Inline Documentation and Comments -->
<rule ref="WordPress-Docs">
<!-- This does not allow for useful @see and @todo tags with surrounding remarks. -->
<exclude name="Generic.Commenting.DocComment.SpacingBeforeTags" />
<!-- We have not yet defined what a standardized file docblock should look like. -->
<!-- See https://github.com/ampproject/amp-toolbox-php/issues/255 -->
<exclude name="Squiz.Commenting.FileComment.Missing" />
<!-- Validator classes are generated with a "DO NOT EDIT" comment that is erroneously output as a docblock. -->
<exclude name="Squiz.Commenting.FileComment.SpacingAfterOpen" />
<!-- Package tags are in class docblocks, not in file docblocks. -->
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag" />
<!-- Do not enforce short descriptions to allow for short type hints. -->
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<!-- Skipping following sniffs because of too many occurrences that require manual fixes. -->
<exclude name="Squiz.Commenting.FunctionComment.Missing" />
<exclude name="Squiz.Commenting.ClassComment.Missing" />
<exclude name="Squiz.Commenting.FunctionCommentThrowTag.Missing" />
<exclude-pattern>tests/*</exclude-pattern>
</rule>
</ruleset>