forked from GlotPress/GlotPress
-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpcs.xml.dist
183 lines (166 loc) · 6.04 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
172
173
174
175
176
177
178
179
180
181
182
183
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for GlotPress">
<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php"/>
<!-- Allow invoking just `phpcs` on command line without assuming STDIN for file input. -->
<file>.</file>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20"/>
<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache"/>
<rule ref="WordPress-Core">
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents" />
<exclude name="WordPress.WP.AlternativeFunctions.file_system_read_file_get_contents" />
</rule>
<rule ref="WordPress-Docs" />
<rule ref="WordPress-Extra">
<!-- _e() and _ex() are considered safe for translations. -->
<exclude name="WordPress.Security.EscapeOutput.UnsafePrintingFunction" />
</rule>
<rule ref="WordPress.Security.EscapeOutput">
<properties>
<property name="customEscapingFunctions" type="array">
<element value="esc_translation"/>
<element value="gp_esc_attr_with_entities"/>
</property>
<property name="customAutoEscapedFunctions" type="array">
<element value="gp_radio_buttons"/>
<element value="gp_select"/>
<element value="gp_projects_dropdown"/>
<element value="gp_locales_dropdown"/>
<element value="gp_locales_by_project_dropdown"/>
<element value="gp_link"/>
<element value="gp_link_get"/>
<element value="gp_link_glossary_edit_get"/>
<element value="gp_link_glossary_delete_get"/>
<element value="gp_link_set_edit_get"/>
<element value="gp_link_set_delete_get"/>
<element value="gp_link_project_get"/>
<element value="gp_link_project_edit_get"/>
<element value="gp_link_project_delete_get"/>
<element value="gp_link_home_get"/>
<element value="gp_link_with_ays_get"/>
<element value="gp_link_user"/>
<element value="gp_js_focus_on"/>
<element value="gp_translation_row_classes"/>
<element value="gp_pagination"/>
<element value="gp_array_of_things_to_json"/>
<element value="gp_array_of_array_of_things_to_json"/>
<element value="gp_project_options_form"/>
<element value="prepare_original"/>
<element value="gp_prepare_translation_textarea"/>
<element value="display_status"/>
<element value="gp_nav_menu"/>
<element value="gp_breadcrumb"/>
<element value="gp_notice"/>
<element value="gp_title"/>
<!-- i18n functions are considered safe for translations. -->
<element value="__"/>
<element value="_x"/>
<element value="_n"/>
<element value="_nx"/>
<element value="number_format_i18n"/>
<element value="date_i18n"/>
<element value="human_time_diff"/>
</property>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<exclude-pattern>/gp-templates/*</exclude-pattern>
<exclude-pattern>/locales/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" value="glotpress" />
</properties>
</rule>
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="maxColumn" value="80"/>
</properties>
</rule>
<rule ref="Generic.Commenting.DocComment.MissingShort">
<!-- Temporarily disabled until https://github.com/WordPress/WordPress-Coding-Standards/issues/403 is fixed. -->
<severity>0</severity>
</rule>
<!-- Set minimum supported WordPress version. -->
<config name="minimum_supported_wp_version" value="4.6"/>
<!-- Run against the PHPCompatibilityWP ruleset -->
<rule ref="PHPCompatibilityWP"/>
<!-- GlotPress currently supports PHP 7.4+. -->
<config name="testVersion" value="7.4-"/>
<exclude-pattern>/tests/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/locales/*</exclude-pattern>
<exclude-pattern>/bin/*</exclude-pattern>
<rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.Missing">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamTag">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamComment">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.ParamNameNoMatch">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentFullStop">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.WrongStyle">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamName">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.SpacingAfter">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.VariableComment.Missing">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.VariableComment.WrongStyle">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FileComment.Missing">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FileComment.SpacingAfterComment">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FileComment.MissingPackageTag">
<type>warning</type>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase">
<type>warning</type>
</rule>
<rule ref="Squiz.Operators.IncrementDecrementUsage.Found">
<type>warning</type>
</rule>
<rule ref="Squiz.PHP.DisallowMultipleAssignments.Found">
<type>warning</type>
</rule>
<rule ref="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure">
<type>warning</type>
</rule>
<rule ref="PSR2.Classes.PropertyDeclaration.VarUsed">
<type>warning</type>
</rule>
<rule ref="PSR2.Classes.PropertyDeclaration.ScopeMissing">
<type>warning</type>
</rule>
<rule ref="WordPress.PHP.DontExtract.extract_extract">
<type>warning</type>
</rule>
</ruleset>