This repository has been archived by the owner on Jun 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
phpcs.xml.dist
96 lines (94 loc) · 4.35 KB
/
phpcs.xml.dist
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
<?xml version="1.0"?>
<ruleset name="The Plugin Name ruleset">
<description>Ruleset for the The Plugin Name.</description>
<file>the-plugin-name.php</file>
<file>./src/</file>
<!-- Additional arguments. -->
<arg value="sp"/>
<arg name="basepath" value="."/>
<arg name="parallel" value="8"/>
<arg name="cache"/>
<arg name="extensions" value="php"/>
<!-- Check for PHP cross-version compatibility. -->
<config name="testVersion" value="7.1-"/>
<rule ref="PHPCompatibilityWP">
<include-pattern>*\.php$</include-pattern>
</rule>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found">
<severity>0</severity>
</rule>
<!-- WordPress coding standards. -->
<!-- https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="5.5"/>
<rule ref="WordPress">
<!-- Exclude as plugin adheres to the PSR-4 standard. -->
<exclude name="WordPress.Files.FileName"/>
<exclude name="NeutronStandard.AssignAlign.DisallowAssignAlign.Aligned"/>
</rule>
<!--https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#custom-input-sanitization-functions-->
<rule ref="WordPress.Security.ValidatedSanitizedInput">
<properties>
<property name="customSanitizingFunctions" type="array">
<element value="prefix_sanitize_url"/>
<element value="prefix_sanitize_postal_code"/>
</property>
<property name="customUnslashingSanitizingFunctions" type="array">
<element value="prefix_sanitize_unslash_url"/>
</property>
</properties>
</rule>
<rule ref="WordPress.Security.NonceVerification">
<properties>
<property name="customSanitizingFunctions" type="array">
<element value="prefix_sanitize_url"/>
<element value="prefix_sanitize_postal_code"/>
</property>
<property name="customUnslashingSanitizingFunctions" type="array">
<element value="prefix_sanitize_unslash_url"/>
</property>
</properties>
</rule>
<!--Internationalization: setting your text domain-->
<!--https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#properties-strongly-recommended-to-be-set-->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="the-plugin-name-text-domain"/>
<element value="library-textdomain"/>
</property>
</properties>
</rule>
<!--Naming Conventions: prefix everything in the global namespace-->
<!--https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#properties-strongly-recommended-to-be-set-->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="ThePluginName"/>
<element value="_THE_PLUGIN_NAME"/>
<element value="the_plugin_name"/>
</property>
</properties>
</rule>
<!-- Allow namespaced hook names in dot notation. -->
<!--https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#custom-word-delimiters-in-hook-names-->
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="."/>
</properties>
</rule>
<!-- https://github.com/Automattic/phpcs-neutron-ruleset/ -->
<!-- These are a set of modern (PHP >7) linting guidelines for WordPress development. -->
<rule ref="NeutronRuleset">
<exclude name="NeutronStandard.Globals.DisallowGlobalFunctions.GlobalFunctions"/>
</rule>
<!-- https://github.com/squizlabs/PHP_CodeSniffer/issues/1578 -->
<rule ref="PEAR.Functions.FunctionCallSignature"/>
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>0</severity>
</rule>
</ruleset>