-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.phpcs.xml.dist
89 lines (70 loc) · 3.11 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
<?xml version="1.0"?>
<ruleset name="Demo Quotes Plugin">
<description>Demo Quotes Plugin rules for PHP_CodeSniffer</description>
<!-- Only check PHP files. -->
<arg name="extensions" value="php"/>
<!-- Show progress, show the error codes for each message (source). -->
<arg value="sp"/>
<!-- Scan all files. -->
<file>.</file>
<exclude-pattern>*/index.php</exclude-pattern>
<!-- Temporary - should be included. -->
<exclude-pattern>uninstall.php</exclude-pattern>
<!-- ##### Sniffs for PHP cross-version compatibility ##### -->
<config name="testVersion" value="5.2-"/>
<rule ref="PHPCompatibility"/>
<!-- ##### Code style ##### -->
<rule ref="WordPress">
<exclude name="WordPress.VIP" />
<!-- Needs further investigation. Usage looks safe. -->
<exclude name="WordPress.CSRF.NonceVerification"/>
</rule>
<!-- ##### Add Configuration for a number of WPCS sniffs ##### -->
<!-- Set the minimum supported WP version. This is used by several sniffs. -->
<config name="minimum_supported_wp_version" value="4.0"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="demo-quotes-plugin,default"/>
</properties>
</rule>
<!-- Verify that everything in the global namespace is prefixed with a plugin specific prefix.
Multiple valid prefixes can be provided as a comma-delimited list. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="demo_quote,demo_quotes,dqp"/>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="_"/>
</properties>
</rule>
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<!-- No need to adjust alignment of large arrays when the item with the largest key is removed. -->
<property name="exact" value="false"/>
<!-- Don't align multi-line items if ALL items in the array are multi-line. -->
<property name="alignMultilineItems" value="!=100"/>
<!-- Array Assignment operator should always be on the same line as the array key. -->
<property name="ignoreNewlines" value="false"/>
</properties>
</rule>
<rule ref="WordPress.Files.FileName">
<!-- Exclude the main plugin file. Renaming after publication would deactivate the plugin. -->
<exclude-pattern>*/demo-quotes-plugin.php</exclude-pattern>
</rule>
<!-- Exclude errors and warnings about commented out code.
As this is a teaching plugin, they actually have a purpose. -->
<rule ref="Squiz.PHP.CommentedOutCode.Found">
<exclude-pattern>*/class-demo-quotes-plugin-cpt.php</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
<exclude-pattern>*/class-demo-quotes-plugin-cpt.php</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.InlineComment.SpacingAfter">
<exclude-pattern>*/class-demo-quotes-plugin-cpt.php</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.BlockComment.NoNewLine">
<exclude-pattern>*/class-demo-quotes-plugin-cpt.php</exclude-pattern>
</rule>
</ruleset>