-
Notifications
You must be signed in to change notification settings - Fork 210
Expand file tree
/
Copy path.phpcs.xml.dist
More file actions
118 lines (109 loc) · 5.05 KB
/
.phpcs.xml.dist
File metadata and controls
118 lines (109 loc) · 5.05 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
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>
<rule ref="WordPress-VIP-Go" />
<!-- Rules: WordPress Coding Standards - see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<rule ref="WordPress-Extra"/> <!-- Includes WordPress-Core -->
<rule ref="WordPress-Docs"/>
<!-- For help in understanding this minimum_supported_wp_version:
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#setting-minimum-supported-wp-version-for-all-sniffs-in-one-go-wpcs-0140 -->
<config name="minimum_supported_wp_version" value="6.4"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="co-authors-plus"/>
</property>
</properties>
</rule>
<rule ref="PHPCompatibilityWP"/>
<config name="testVersion" value="7.4-"/>
<!-- How to scan -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg value="n"/> <!-- No warnings -->
<arg name="colors"/> <!-- Show results with colors. Disable if working on Windows -->
<arg name="basepath" value="."/> <!-- Strip the file paths down to the relevant bit -->
<arg name="parallel" value="8"/> <!-- Enables parallel processing when available for faster results -->
<arg name="extensions" value="php"/> <!-- Limit to PHP files -->
<!-- Allow invoking just `phpcs` on command line without assuming STDIN for file input. -->
<file>.</file>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/build/*</exclude-pattern>
<!-- Legacy files with non-standard names (renaming would break requires) -->
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>php/class-coauthors-iterator.php</exclude-pattern>
<exclude-pattern>php/class-coauthors-endpoint.php</exclude-pattern>
<exclude-pattern>php/class-wp-cli.php</exclude-pattern>
<exclude-pattern>php/integrations/yoast.php</exclude-pattern>
</rule>
<!-- Exclusions for tests directory -->
<!-- Test code doesn't need the same documentation as production code -->
<rule ref="WordPress-Docs">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Commenting.DocComment.MissingShort">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- PHPUnit test files use PascalCase naming convention -->
<rule ref="WordPress.Files.FileName">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Test namespaces don't need plugin prefix -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Tests interact with WordPress globals and hooks -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Test stubs may have mixed structure -->
<rule ref="Universal.Files.SeparateFunctionsFromOO.Mixed">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Unused parameters common in test method signatures -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Tests may need to override WordPress globals for setup -->
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Test bootstrap may need runtime configuration -->
<rule ref="WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_putenv">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- eval() may be needed for mocking functions in tests -->
<rule ref="Squiz.PHP.Eval.Discouraged">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Tests may use restricted functions like count_user_posts() -->
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.count_user_posts_count_user_posts">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Tests don't need nonce verification -->
<rule ref="WordPress.Security.NonceVerification.Missing">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Exception messages in tests don't need escaping -->
<rule ref="WordPress.Security.EscapeOutput.ExceptionNotEscaped">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Tests can use $_POST/$_GET directly without validation -->
<rule ref="WordPress.Security.ValidatedSanitizedInput.InputNotValidated">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Test filter callbacks may intentionally not return -->
<rule ref="WordPressVIPMinimum.Hooks.AlwaysReturnInFilter.MissingReturnStatement">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
</ruleset>