-
Notifications
You must be signed in to change notification settings - Fork 12
/
phpcs.xml
88 lines (67 loc) · 3.08 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0"?>
<ruleset name="Grizzly">
<description>Grizzly Coding Standards</description>
<!-- Scan these files -->
<file>./</file>
<!-- Exclude these files -->
<exclude-pattern>*/vendor/</exclude-pattern>
<!-- Show colors in console -->
<arg value="-colors"/>
<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Use PSR-2 as a base -->
<rule ref="PSR2">
<!-- Allow opening braces to be on same line -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
<!-- Don't require camel case function names -->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
<!-- Allow long lines -->
<exclude name="Generic.Files.LineLength.TooLong"/>
<!-- Disable newline after opening brace -->
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
<!-- Allow closing braces to be on the same line -->
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace"/>
<!-- Allow PHP closing tags -->
<exclude name="PSR2.Files.ClosingTag.NotAllowed"/>
<!-- Allow multiple PHP statements in the same line -->
<exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
<!-- Allow hooks and filters to be used -->
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
</rule>
<!-- Required opening braces to be on same line -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<!-- Allow PHP files without any PHP in them -->
<rule ref="Internal.NoCodeFound">
<exclude-pattern>*.php</exclude-pattern>
</rule>
<!-- Allow blank lines at start of control structures in PHP -->
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen">
<exclude-pattern>*.php</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
</rule>
<!-- Allow blank lines at end of control structures in PHP -->
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose">
<exclude-pattern>*.php</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
</rule>
<!-- Everything but PHP should have indent level 2 -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<exclude-pattern>*.php</exclude-pattern>
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<!-- Don't require namespacing in builder or test files -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>./wp-content/plugins/grizzly-builder/</exclude-pattern>
<exclude-pattern>./tests</exclude-pattern>
</rule>
<!-- Allow inline control strucutres in js files -->
<rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
<exclude-pattern>*.js</exclude-pattern>
</rule>
<!-- Allow braces on same line in js files -->
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine">
<exclude-pattern>*.js</exclude-pattern>
</rule>
</ruleset>