-
Notifications
You must be signed in to change notification settings - Fork 10
/
phpcs.xml.dist
151 lines (128 loc) · 6.04 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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?xml version="1.0"?>
<ruleset name="Eightshift Library">
<description>Eightshift Library uses extended WordPress coding standards with some minor corrections.</description>
<rule ref="Eightshift"/>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/src/commands/templates/*</exclude-pattern>
<exclude-pattern>*/src/Build/BuildExample.php</exclude-pattern>
<exclude-pattern>*/bin/cli.php</exclude-pattern>
<!-- Additional arguments. -->
<arg value="sp"/>
<arg name="basepath" value="."/>
<arg name="parallel" value="8"/>
<arg name="extensions" value="php"/>
<file>.</file>
<!-- Check for PHP cross-version compatibility. -->
<config name="testVersion" value="8.2-"/>
<rule ref="PHPCompatibilityWP"/>
<!-- Support only latest 3 WP versions. -->
<config name="minimum_supported_wp_version" value="8.0"/>
<exclude-pattern>/src/CompiledContainer\.php</exclude-pattern>
<rule ref="WordPress.PHP.DiscouragedPHPFunctions.system_calls_system">
<exclude-pattern>*/src/**/*Cli</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents">
<exclude-pattern>*/src/**/*Cli</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DiscouragedPHPFunctions.system_calls_shell_exec">
<exclude-pattern>*/src/Db/*</exclude-pattern>
<exclude-pattern>*/src/Build/*</exclude-pattern>
<exclude-pattern>*/cliOutput/bin/Build.php</exclude-pattern>
<exclude-pattern>*/src/LintPhp/LintPhpCli.php</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_read_fopen">
<exclude-pattern>*/src/Cli/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_read_fwrite">
<exclude-pattern>*/src/Cli/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_read_fclose">
<exclude-pattern>*/src/Cli/*</exclude-pattern>
</rule>
<rule ref="PSR12.Operators.OperatorSpacing.NoSpaceAfter">
<exclude-pattern>*/src/*/*Example.php</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/plugin/</exclude-pattern>
</rule>
<rule ref="PSR12.Operators.OperatorSpacing.NoSpaceBefore">
<exclude-pattern>*/src/*/*Example.php</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/plugin/</exclude-pattern>
</rule>
<rule ref="Eightshift.Security.HelpersEscape.OutputNotEscaped">
<exclude-pattern>*/src/*/*Example.php</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/plugin/</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants.NonFullyQualified">
<exclude-pattern>*/src/*/*Example.php</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/plugin/</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName">
<exclude-pattern>*/src/*/*Example.php</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/clean/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/standard/plugin/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/theme/</exclude-pattern>
<exclude-pattern>*/src/InitSetup/tailwind/plugin/</exclude-pattern>
</rule>
<rule ref="Internal.NoCodeFound">
<exclude-pattern>*/src/GitIgnore/GitIgnoreExample.php</exclude-pattern>
</rule>
<!-- Ignore unescaped exceptions. All Eightshift exceptions are escaped. -->
<rule ref="Eightshift.Security.HelpersEscape.ExceptionNotEscaped">
<severity>0</severity>
</rule>
<!-- Ignore filesystem alternative functions. -->
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_mkdir">
<severity>0</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.unlink_unlink">
<severity>0</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_fopen">
<severity>0</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_fwrite">
<severity>0</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_fclose">
<severity>0</severity>
</rule>
<rule ref="Generic.Files.LineLength">
<exclude-pattern>*/src/**/*Cli.php</exclude-pattern>
<properties>
<property name="lineLimit" value="180" />
<property name="ignoreComments" value="true" />
</properties>
</rule>
<!-- Add additional extending CLI classes. -->
<rule ref="Eightshift.Commenting.FunctionComment">
<properties>
<property name="allowedExtendedClasses" type="array">
<element value="AbstractCli"/>
<element value="AbstractBlocksCli"/>
</property>
</properties>
</rule>
</ruleset>