Repository navigation
Expand file tree
/
Copy pathphpcs.xml
More file actions
77 lines (65 loc) · 3.92 KB
/
Copy pathphpcs.xml
File metadata and controls
77 lines (65 loc) · 3.92 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0"?>
<ruleset name="PHP CodeSniffer Configuration">
<description>PHP CodeSniffer configuration</description>
<!-- PHP & WP version requirement -->
<config name="testVersion" value="7.4-" />
<config name="minimum_supported_wp_version" value="5.0"/>
<!--
Only errors fail the run. Warnings are still reported with -w, but they
flag things to review (direct DB calls, meta queries, unused parameters),
not code that is wrong, so they must not make phpcs exit non-zero.
-->
<arg name="warning-severity" value="0"/>
<!-- Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>
<!-- WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<rule ref="WordPress">
<!-- Exclude specific rules -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.NamingConventions.PrefixAllGlobals" />
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
<exclude name="Universal.Arrays.DisallowShortArraySyntax" />
<exclude name="WordPress.PHP.YodaConditions" />
<exclude name="Squiz.PHP.CommentedOutCode"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
</rule>
<!-- Exclude non-WordPress sniffs globally -->
<exclude ref="Squiz.Commenting.FileComment.Missing" />
<exclude ref="Squiz.Commenting.FileComment.MissingPackageTag" />
<!-- Customize the I18n rule; Set text domain -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="subscription" />
</property>
</properties>
</rule>
<!--
Tests keep the formatting rules but not the structural ones: a test
stubs WordPress with several classes or functions in one file, under
the global namespace, and names its doubles after what they stand in for.
-->
<rule ref="Squiz.Commenting.FileComment"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="Squiz.Commenting.ClassComment"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="Squiz.Commenting.FunctionComment"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="Squiz.Commenting.VariableComment"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="Generic.Commenting.DocComment"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="Generic.Files.OneObjectStructurePerFile"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="Universal.Files.SeparateFunctionsFromOO"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="Universal.Namespaces.DisallowCurlyBraceSyntax"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="Universal.Namespaces.DisallowDeclarationWithoutName"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="Universal.Namespaces.OneDeclarationPerFile"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="WordPress.WP.GlobalVariablesOverride"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="WordPress.NamingConventions.ValidVariableName"><exclude-pattern>tests/</exclude-pattern></rule>
<rule ref="WordPress.NamingConventions.ValidFunctionName"><exclude-pattern>tests/</exclude-pattern></rule>
<!-- Exclude the following directories -->
<exclude-pattern>assets/</exclude-pattern>
<exclude-pattern>build/</exclude-pattern>
<exclude-pattern>vendor/</exclude-pattern>
<exclude-pattern>node_modules/</exclude-pattern>
<exclude-pattern>releases/</exclude-pattern> <!-- gitignored release builds -->
<exclude-pattern>tests/Support/plan-selector-before-layouts.php</exclude-pattern> <!-- frozen copy of old markup; never reformat -->
</ruleset>