-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
executable file
·100 lines (81 loc) · 3.9 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
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version="1.0"?>
<ruleset name="Inno Oppiva">
<description>
Inno Oppiva coding standards definition. Mostly WordPress coding standards, but relaxed a bit to be
easier on developers.
Inspired by Seravo PHP Coding standards.
</description>
<!-- Show sniff progress -->
<arg value="p"/>
<!-- All files should be UTF-8 encoded. -->
<arg name="encoding" value="utf-8"/>
<!-- check current and all subfolders if no file parameter given. -->
<file>.</file>
<!--
Include WordPress Coding Standards with some exclusions. WordPress-Extra contains an extended
ruleset for recommended best practices, see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards#rulesets for details
about different WordPress subsets.
-->
<rule ref="WordPress-Extra">
<!-- Exclude some rules that conflict with the use of two spaces instead of four spaces or tabs
for indentation -->
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
<exclude name="WordPress.WhiteSpace.PrecisionAlignment.Found" />
<exclude name="WordPress.Arrays.ArrayIndentation.ItemNotAligned" />
<exclude name="WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned" />
<exclude name="PEAR.Functions.FunctionCallSignature" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BreakIndent" />
<!-- There is no need to align equals signs -->
<exclude name="Generic.Formatting.MultipleStatementAlignment" />
<!-- Don't enforce the usage of excessive amounts of whitespace -->
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket" />
<!-- Yoda Condition checks reduce code readability with very little benefit -->
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
<!-- Don't enforce the usage of class files with name "class-*.php". -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<!-- We need to use PHP system calls to provide grahpical wrappers for CLI commands. -->
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.system_calls_exec" />
<!-- Don't enforce the usage of escaped output in every situation, the security risks should be
assessed separately. Also we can't always use nonces e.g. for APIs... -->
<exclude name="WordPress.CSRF.NonceVerification.NoNonceVerification" />
<exclude name="WordPress.XSS.EscapeOutput" />
<exclude name="WordPress.Security.EscapeOutput.UnsafePrintingFunction" />
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped" />
<exclude name="WordPress.Security.NonceVerification.NoNonceVerification" />
</rule>
<!--
Add some custom sniff rules here. See
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties for available
sniffs and their properties.
-->
<!-- Code blocks should be indented with two (2) spaces -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2" />
<property name="exact" value="false" />
<property name="tabIndent" value="false" />
</properties>
</rule>
<!-- The soft limit on line length is 100 characters. However, do not trigger errors if the limit
is exceeded. -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="100"/>
<property name="absoluteLineLimit" value="0"/>
</properties>
</rule>
<!-- Allow concatenation of multiple strings if they are located on multiple lines -->
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<properties>
<property name="allowMultiline" value="true" />
</properties>
</rule>
<!-- Enforce that multiline arrays are indented with two spaces -->
<rule ref="Generic.Arrays.ArrayIndent">
<properties>
<property name="indent" value="2" />
</properties>
</rule>
</ruleset>