-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
50 lines (38 loc) · 1.85 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
<?xml version="1.0"?>
<ruleset name="wp-libre-form">
<description>For nicer WordPress and PHP development</description>
<!-- Files and directories to parse -->
<file>./index.php</file>
<!-- Excluded directories and files -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/lang/*</exclude-pattern>
<exclude-pattern>*/assets/*</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
<!-- Use 2 spaces for indentation -->
<arg name="tab-width" value="2"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<!-- No TODO comments, open issues in github/gogs/gitlab instead -->
<rule ref="Generic.Commenting.Todo"/>
<!-- Don't allow oneliner ifs without brackets {} -->
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="PSR12">
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<!-- I don't understand why PSR2 uses this rule as well as defining their own identical rule. -->
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
<!-- Yeah how about no, K&R FTW -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine" />
<!-- This isn't MVC. Don't make life hard for trying to use HTML. -->
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
<!-- This rule leads to some absurd indents in multiline function calls, such as createSelector -->
<exclude name="PSR2.Methods.FunctionCallSignature.Indent" />
</rule>
<!-- Require the brace to be on the same line -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
</ruleset>