-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
106 lines (95 loc) · 4.37 KB
/
Copy pathphpcs.xml
File metadata and controls
106 lines (95 loc) · 4.37 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
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>
<config name="text_domain" value="send-to-e-reader" />
<rule ref="WordPress-Core">
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" />
<exclude name="Squiz.Commenting.VariableComment.Missing" />
<exclude name="Squiz.Commenting.FunctionComment.Missing" />
</rule>
<rule ref="WordPress-Docs" />
<rule ref="WordPress.WP.GlobalVariablesOverride.OverrideProhibited">
<exclude-pattern>bin/tests/isolated/*</exclude-pattern>
</rule>
<rule ref="WordPress.Security.EscapeOutput">
<properties>
<!-- Some common functions that might technically require output escaping, but rarely cause anything but false positives -->
<property name="customAutoEscapedFunctions" type="array">
<element key="__" value="__" />
<element key="_e" value="_e" />
<element key="_x" value="_x" />
<element key="wp_create_nonce" value="wp_create_nonce" />
<element key="plugin_dir_url" value="plugin_dir_url" />
<element key="plugins_url" value="plugins_url" />
<element key="admin_url" value="admin_url" />
<element key="sanitize_text_field" value="sanitize_text_field" />
<element key="sanitize_textarea_field" value="sanitize_textarea_field" />
<element key="get_locale" value="get_locale" />
<element key="get_bloginfo" value="get_bloginfo" /> <!-- only safe if 'display' filter is used -->
</property>
</properties>
<type>warning</type>
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
<exclude-pattern>*/widgets/*</exclude-pattern>
<exclude-pattern>*/templates/email/*.text.php</exclude-pattern>
</rule>
<rule ref="WordPress.Security.EscapeOutput.UnsafePrintingFunction">
<type>warning</type>
</rule>
<!-- The test bootstrap is one file of WordPress function and class stubs.
One class per file, class doc comments and named namespace blocks do
not apply to it, and its parameter names deliberately mirror the real
WordPress signatures, reserved words and all. -->
<rule ref="Generic.Files.OneObjectStructurePerFile">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Universal.Namespaces.DisallowCurlyBraceSyntax">
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
</rule>
<rule ref="Universal.Namespaces.DisallowDeclarationWithoutName">
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
</rule>
<rule ref="Universal.Namespaces.OneDeclarationPerFile">
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
</rule>
<rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames">
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
</rule>
<rule ref="WordPress.WP.I18n">
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
</rule>
<rule ref="WordPress.DateTime.RestrictedFunctions">
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
</rule>
<!-- PHPUnit discovers test classes by their own naming convention. -->
<rule ref="WordPress.Files.FileName">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!-- DOM node properties (childNodes, nodeName, nodeValue, tagName) are
PHP's own API and cannot be renamed. -->
<rule ref="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase">
<exclude-pattern>includes/class-ai-assistant-integration.php</exclude-pattern>
</rule>
<!-- Mirrors get_template_part()'s own $echo parameter. -->
<rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.echoFound">
<exclude-pattern>includes/class-e-reader.php</exclude-pattern>
<exclude-pattern>includes/class-send-to-e-reader.php</exclude-pattern>
</rule>
<!-- Templates are markup, not classes. -->
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>templates/*</exclude-pattern>
</rule>
<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php"/>
<file>.</file>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/libs/*</exclude-pattern>
<exclude-pattern>blocks/*/build/index.asset.php</exclude-pattern>
</ruleset>