Repository navigation
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
127 lines (112 loc) · 4.1 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
127 lines (112 loc) · 4.1 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
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
<?xml version="1.0"?>
<ruleset
name="WPCS for Elementify"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd"
>
<description>Sniffs for Elementify</description>
<!-- What to scan -->
<file>.</file>
<!-- Exclude paths -->
<exclude-pattern>**/build/**</exclude-pattern>
<exclude-pattern>**/artifacts/**</exclude-pattern>
<exclude-pattern>**/node_modules/**</exclude-pattern>
<exclude-pattern>**/vendor/**</exclude-pattern>
<exclude-pattern>**/vendor-prefixed/**</exclude-pattern>
<exclude-pattern>**/tests/**</exclude-pattern>
<!-- CLI args -->
<arg value="sp" />
<arg name="basepath" value="./" />
<arg name="colors" />
<arg name="extensions" value="php" />
<arg name="cache" value=".phpcs-cache.json" />
<arg name="parallel" value="20" />
<arg name="severity" value="1" />
<!-- PHP version compatibility: matches "Requires PHP" in style.css -->
<config name="testVersion" value="7.4-" />
<!-- WordPress version compatibility: matches "Requires at least" in style.css -->
<config name="minimum_supported_wp_version" value="6.4" />
<!--
PHPCompatibility + PHPCompatibilityWP
@see: https://github.com/PHPCompatibility/PHPCompatibilityWP
-->
<rule ref="PHPCompatibilityWP" />
<!--
Core WordPress Coding Standards
@see: https://github.com/WordPress/WordPress-Coding-Standards
-->
<rule ref="WordPress-Extra">
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<exclude name="Universal.Arrays.DisallowShortArraySyntax" />
<exclude name="Universal.Operators.DisallowShortTernary" />
<exclude name="WordPress.Files.FileName" />
<!-- Deprecated in PHPCS v4 -->
<exclude name="Generic.Functions.CallTimePassByReference" />
</rule>
<rule ref="WordPress-Docs">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<!-- Enforce short array syntax [] over array() -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<!--
Test-specific exclusions
-->
<rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="Generic.PHP.NoSilencedErrors">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DiscouragedPHPFunctions">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.NoSilencedErrors">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPress.WP.EnqueuedResources.NonEnqueuedScript">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<!--
Theme-specific customizations
-->
<!-- Enforce theme prefix on all globals -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<exclude-pattern>**/tests/**</exclude-pattern>
<properties>
<property name="prefixes" type="array">
<element value="ELEMENTIFY" /><!-- Constants -->
<element value="Elementify" /><!-- Classes -->
<element value="elementify_" /><!-- Functions/variables -->
</property>
</properties>
</rule>
<!-- Enforce text domain -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="elementify" />
</property>
</properties>
</rule>
<!--
Template parts are loaded through get_template_part()/load_template(),
so their file-scope variables are function-local at runtime, not real
globals. Do not require the theme prefix on them.
-->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound">
<exclude-pattern>**/template-parts/**</exclude-pattern>
</rule>
<!--
Breadcrumb_Trail is a vendored third-party library. Its filter names are
part of that library's public API and must not be renamed.
-->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound">
<exclude-pattern>**/inc/classes/class-breadcrumb-trail.php</exclude-pattern>
</rule>
</ruleset>