-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
73 lines (60 loc) · 2.54 KB
/
phpcs.xml
File metadata and controls
73 lines (60 loc) · 2.54 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
<?xml version="1.0"?>
<ruleset name="Silver Assist ACF Clone Fields">
<description>WordPress Coding Standards for Silver Assist ACF Clone Fields Plugin</description> <!-- What to scan -->
<file>.</file>
<!-- Exclude paths -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/.git/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/build/*</exclude-pattern>
<exclude-pattern>*/assets/js/*</exclude-pattern>
<exclude-pattern>*/assets/css/*</exclude-pattern>
<!-- Show progress -->
<arg value="ps"/>
<!-- Show colors in terminal -->
<arg name="colors"/>
<!-- Check code for cross-version PHP compatibility. -->
<config name="testVersion" value="8.2-"/>
<!-- Include the WordPress-Extra standard. -->
<rule ref="WordPress-Extra">
<!-- Allow short array syntax -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<!-- We use PSR-4 PascalCase filenames, not WordPress hyphenated lowercase -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<!-- Allow opening braces on same line (K&R style) -->
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<exclude name="Generic.Classes.OpeningBraceSameLine"/>
</rule>
<!-- Allow short array syntax explicitly -->
<rule ref="Universal.Arrays.DisallowShortArraySyntax">
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
</rule>
<!-- Enforce WordPress naming conventions -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="silver_acf_clone"/>
<element value="SilverAssist\ACFCloneFields"/>
</property>
</properties>
</rule>
<!-- Let's also check that everything is properly documented. -->
<rule ref="WordPress-Docs"/>
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
<!-- Check for PHP cross-version compatibility. -->
<config name="minimum_supported_wp_version" value="6.5"/>
<!-- Verify that everything in the global namespace is prefixed. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="SilverAssist\ACFCloneFields"/>
<element value="silver_acf_clone"/>
<element value="silver_assist_acf_clone_fields"/>
</property>
</properties>
</rule>
</ruleset>