-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
110 lines (93 loc) · 3.65 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
110 lines (93 loc) · 3.65 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="Starisian WordPress Plugin"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
<description>
WordPress coding standards for Starisian Technologies plugins. Includes support for Docs, I18n, and performance best practices.
</description>
<!-- Scan only root PHP files and src directory -->
<file>src/</file>
<file>sparxstar-gluon.php</file>
<file>uninstall.php</file>
<!-- Exclude unnecessary paths -->
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>*.min.js</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
<exclude-pattern>wp-assets/*</exclude-pattern>
<exclude-pattern>assets/*</exclude-pattern>
<exclude-pattern>data/*</exclude-pattern>
<exclude-pattern>docs/*</exclude-pattern>
<exclude-pattern>examples/*</exclude-pattern>
<exclude-pattern>schemas/*</exclude-pattern>
<!-- Basepath -->
<arg name="basepath" value="."/>
<!-- Parallel processing -->
<arg name="parallel" value="8"/>
<!-- Coding standard rules -->
<rule ref="WordPress-Extra"/>
<rule ref="WordPress-Docs"/>
<rule ref="Generic.Commenting.Todo"/>
<!-- Minimum WordPress version for compatibility checks -->
<config name="minimum_wp_version" value="6.4"/>
<!-- Text domain config (override per project if needed) -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="plugin-textdomain"/>
<element value="sparxstar-gluon"/>
</property>
</properties>
</rule>
<!-- Global prefix enforcement -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="starisian"/>
<element value="sparxstar"/>
<element value="spx"/>
</property>
</properties>
</rule>
<!-- Allow modern PSR-4 class naming conventions -->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false"/>
</properties>
<exclude-pattern>src/*</exclude-pattern>
</rule>
<!-- Exclude method name validation for PSR-4 namespaced classes -->
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<exclude-pattern>src/*</exclude-pattern>
<exclude-pattern>sparxstar-gluon.php</exclude-pattern>
<exclude-pattern>uninstall.php</exclude-pattern>
</rule>
<!-- Exclude variable name validation for PSR-4 classes -->
<rule ref="WordPress.NamingConventions.ValidVariableName">
<exclude-pattern>src/*</exclude-pattern>
<exclude-pattern>sparxstar-gluon.php</exclude-pattern>
</rule>
<!-- Allow inline comments without punctuation in src/ -->
<rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
<exclude-pattern>src/*</exclude-pattern>
</rule>
<!-- Exclude doc comment requirement for private methods -->
<rule ref="Squiz.Commenting.FunctionComment.Missing">
<exclude-pattern>src/*</exclude-pattern>
</rule>
<!-- Exclude certain sniffs in test files -->
<rule ref="WordPress.WP.GlobalVariablesOverride">
<exclude-pattern>tests/*Test.php</exclude-pattern>
</rule>
<rule ref="WordPress.Files.FileName">
<exclude-pattern>tests/*Test.php</exclude-pattern>
</rule>
<!-- Optional: Uncomment if PHPCompatibilityWP is installed -->
<!--
<config name="testVersion" value="8.2-"/>
<rule ref="PHPCompatibilityWP">
<include-pattern>*.php</include-pattern>
</rule>
-->
</ruleset>