Repository navigation
Expand file tree
/
Copy pathphpcs.xml
More file actions
57 lines (49 loc) · 2.65 KB
/
Copy pathphpcs.xml
File metadata and controls
57 lines (49 loc) · 2.65 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Laranail Notifications Coding Standard">
<description>PSR-12 conformance lint for laranail/notifications (formatting is owned by Pint).</description>
<arg value="p"/>
<arg value="s"/>
<arg name="colors"/>
<!-- Line-length and similar warnings stay visible but do not fail the gate. -->
<!-- NOTE: `ignore_warnings_on_exit` was REMOVED in PHP_CodeSniffer 4.0 and CI
resolves 4.x, so this line does nothing. It is left in place only for a
3.x run; do not rely on it. Under 4.x a warning fails the build, and the
sniff that produces it has to be excluded by name; see
laranail/toolkit does after 186 line-length warnings turned its gate red
with zero errors. -->
<config name="ignore_warnings_on_exit" value="1"/>
<!-- Paths to check -->
<file>src</file>
<file>tests</file>
<!-- Exclude paths -->
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<!-- Fixtures are data/tooling, not style-governed source. -->
<exclude-pattern>tests/Fixtures/*</exclude-pattern>
<!-- PSR-12 base. Pint owns formatting; exclude the sniffs that fight its
PER-style single-line empty bodies (`class Foo {}` / `) {}`). -->
<rule ref="PSR12">
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
<!-- `new Foo` vs `new Foo()`. Pint's new_with_parentheses fixer owns
this, and the two cannot both be satisfied: running phpcbf took
PHPCS to 0 errors, and Pint then stripped every parenthesis back
out. Measured on this tree - all 8 errors were this one code. -->
<exclude name="PSR12.Classes.ClassInstantiation.MissingParentheses"/>
</rule>
<!-- Test methods follow PHPUnit's snake_case convention. -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!-- Tests may colocate small fixture classes alongside the test class. -->
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!-- Clean-code (built-in sniffs only) -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
</ruleset>