forked from bonny/WordPress-Simple-History
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml.dist
171 lines (149 loc) Β· 6.37 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version="1.0"?>
<ruleset name="Simple-History">
<description>WordPress Coding Standards for Simple History</description>
<config name="testVersion" value="7.4-"/>
<!-- Show progress while running -->
<arg value="p"/>
<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Show results with colors -->
<arg name="colors"/>
<!-- Don't show warnings -->
<arg value="n"/>
<!-- Only scan PHP files. -->
<arg name="extensions" value="php"/>
<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20"/>
<!-- Process current dir by default-->
<file>.</file>
<!-- Exclude composer dir and similar -->
<exclude-pattern>*/vendor/</exclude-pattern>
<exclude-pattern>*/node_modules/</exclude-pattern>
<exclude-pattern>*/build/</exclude-pattern>
<exclude-pattern>*/tests/</exclude-pattern>
<exclude-pattern>*/data/</exclude-pattern>
<!--
Info about customizable things:
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
Also see example XML:
https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample
-->
<config name="minimum_supported_wp_version" value="6.1"/>
<rule ref="Generic.Commenting.DocComment.MissingShort">
<!-- Temporarily disabled until https://github.com/WordPress/WordPress-Coding-Standards/issues/403 is fixed. -->
<severity>0</severity>
</rule>
<rule ref="WordPress">
<exclude name="Squiz.Commenting.FileComment.Missing" />
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag" />
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.ShortPrefixPassed"/>
<!-- I like short arrays, so allow them. -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound" />
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase" />
<!-- Can't change the hook names we already have. -->
<exclude name="WordPress.NamingConventions.ValidHookName.NotLowercase" />
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="simple-history"/>
</property>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="sh"/>
<element value="simplehistory"/>
<element value="simple_history"/>
</property>
</properties>
</rule>
<!-- Add this and fix when all other things are fixed.-->
<!-- <rule ref="WordPress-Docs"/> -->
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="-/"/>
</properties>
</rule>
<rule ref="PHPCompatibilityWP"/>
<rule ref="WordPress.Security.EscapeOutput">
<properties>
<property name="customEscapingFunctions" type="array">
<element value="esc_xml"/>
</property>
</properties>
</rule>
<!-- Disallow mb functions since they are not available on all PHP server configs -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array" extend="true">
<element key="mb_check_encoding" value="null" />
<element key="mb_chr" value="null" />
<element key="mb_convert_case" value="null" />
<element key="mb_convert_encoding" value="null" />
<element key="mb_convert_kana" value="null" />
<element key="mb_convert_variables" value="null" />
<element key="mb_decode_mimeheader" value="null" />
<element key="mb_decode_numericentity" value="null" />
<element key="mb_detect_encoding" value="null" />
<element key="mb_detect_order" value="null" />
<element key="mb_encode_mimeheader" value="null" />
<element key="mb_encode_numericentity" value="null" />
<element key="mb_encoding_aliases" value="null" />
<element key="mb_ereg_match" value="null" />
<element key="mb_ereg_replace_callback" value="null" />
<element key="mb_ereg_replace" value="null" />
<element key="mb_ereg_search_getpos" value="null" />
<element key="mb_ereg_search_getregs" value="null" />
<element key="mb_ereg_search_init" value="null" />
<element key="mb_ereg_search_pos" value="null" />
<element key="mb_ereg_search_regs" value="null" />
<element key="mb_ereg_search_setpos" value="null" />
<element key="mb_ereg_search" value="null" />
<element key="mb_ereg" value="null" />
<element key="mb_eregi_replace" value="null" />
<element key="mb_eregi" value="null" />
<element key="mb_get_info" value="null" />
<element key="mb_http_input" value="null" />
<element key="mb_http_output" value="null" />
<element key="mb_internal_encoding" value="null" />
<element key="mb_language" value="null" />
<element key="mb_list_encodings" value="null" />
<element key="mb_ord" value="null" />
<element key="mb_output_handler" value="null" />
<element key="mb_parse_str" value="null" />
<element key="mb_preferred_mime_name" value="null" />
<element key="mb_regex_encoding" value="null" />
<element key="mb_regex_set_options" value="null" />
<element key="mb_scrub" value="null" />
<element key="mb_send_mail" value="null" />
<element key="mb_split" value="null" />
<element key="mb_str_split" value="null" />
<element key="mb_strcut" value="null" />
<element key="mb_strimwidth" value="null" />
<element key="mb_stripos" value="null" />
<element key="mb_stristr" value="null" />
<element key="mb_strlen" value="null" />
<element key="mb_strpos" value="null" />
<element key="mb_strrchr" value="null" />
<element key="mb_strrichr" value="null" />
<element key="mb_strripos" value="null" />
<element key="mb_strrpos" value="null" />
<element key="mb_strstr" value="null" />
<element key="mb_strtolower" value="null" />
<element key="mb_strtoupper" value="null" />
<element key="mb_strwidth" value="null" />
<element key="mb_substitute_character" value="null" />
<element key="mb_substr_count" value="null" />
<element key="mb_substr" value="null" />
</property>
</properties>
</rule>
</ruleset>