-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathphpcs.xml
More file actions
173 lines (154 loc) · 7.35 KB
/
phpcs.xml
File metadata and controls
173 lines (154 loc) · 7.35 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
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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="connections" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Custom ruleset for Connections Business Directory plugin.</description>
<!-- For help in understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- For help in using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- What to scan -->
<file>.</file>
<!-- Ignoring Files and Folders:
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders -->
<exclude-pattern>/assets/vendor/*</exclude-pattern>
<exclude-pattern>/assets/dist/*</exclude-pattern>
<exclude-pattern>/includes/Libraries/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- How to scan -->
<!-- Show sniff and progress -->
<arg value="sp"/>
<!-- Show results with colors -->
<arg name="colors"/>
<!-- Strip the file paths down to the relevant bit -->
<arg name="basepath" value="."/>
<!-- Enables parallel processing when available for faster results. -->
<arg name="parallel" value="4"/>
<!-- Limit to PHP files -->
<arg name="extensions" value="php"/>
<!-- Rules: Check PHP version compatibility - see
https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>
<!-- For help in understanding this testVersion:
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="7.0-"/>
<!-- Squiz Rules -->
<rule ref="Squiz.Commenting.BlockComment">
<exclude name="Squiz.Commenting.BlockComment.HasEmptyLineBefore"/>
<exclude name="Squiz.Commenting.BlockComment.NoEmptyLineBefore"/>
</rule>
<rule ref="Squiz.NamingConventions.ValidVariableName">
<exclude name="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps"/>
<exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/>
<exclude name="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore"/>
<exclude name="Squiz.NamingConventions.ValidVariableName.PropertyNotCamelCaps"/>
<exclude name="Squiz.NamingConventions.ValidVariableName.StringNotCamelCaps"/>
</rule>
<rule ref="Squiz.PHP.CommentedOutCode">
<exclude name="Squiz.PHP.CommentedOutCode.Found"/>
</rule>
<!-- Rules: WordPress Coding Standards - see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- WordPress-Extra includes WordPress-Core -->
<rule ref="WordPress-Core"/>
<rule ref="WordPress-Extra"/>
<rule ref="WordPress-Docs"/>
<!-- For help in understanding these custom sniff properties:
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="5.6"/>
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="alignMultilineItems" value="!=100"/>
</properties>
</rule>
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array">
<element value="connections_add_entry"/>
<element value="connections_add_entry_moderated"/>
<element value="connections_change_settings"/>
<element value="connections_change_roles"/>
<element value="connections_delete_entry"/>
<element value="connections_edit_categories"/>
<element value="connections_edit_entry"/>
<element value="connections_edit_entry_moderated"/>
<element value="connections_manage"/>
<element value="connections_manage_template"/>
<element value="connections_view_menu"/>
<element value="connections_view_dashboard"/>
<element value="connections_view_public"/>
<element value="connections_view_private"/>
<element value="connections_view_unlisted"/>
</property>
</properties>
</rule>
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false"/>
</properties>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<!--<element value="cn"/> Two character prefixes are no longer permitted; ref: https://github.com/WordPress/WordPress-Coding-Standards/issues/1836 -->
<element value="cn_"/>
<element value="connections"/>
<element value="Connections_Directory"/>
</property>
</properties>
</rule>
<rule ref="Universal.WhiteSpace.PrecisionAlignment">
<properties>
<property name="ignoreAlignmentBefore" type="array">
<element value="T_COMMENT"/>
<element value="T_DOC_COMMENT_WHITESPACE"/>
<element value="T_INLINE_HTML"/>
<element value="T_WHITESPACE"/>
<!-- Ignore precision alignment in multiline chained method calls. -->
<element value="T_OBJECT_OPERATOR"/>
<element value="T_NULLSAFE_OBJECT_OPERATOR"/>
</property>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="connections"/>
</property>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
<!--Exclude a few WPCS rules.-->
<rule ref="WordPress-Core">
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterStart"/>
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd"/>
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineBeforeEnd"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound"/>
<exclude name="WordPress.NamingConventions.ValidHookName.NotLowercase"/>
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/>
<exclude name="WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid"/>
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase"/>
</rule>
<rule ref="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps"/>
<rule ref="Squiz.NamingConventions.ValidVariableName.StringNotCamelCaps"/>
<!-- WordPress insists on long array syntax, so let's ignore that, and insist on short array syntax. -->
<!--<rule ref="WordPress">-->
<!-- <exclude name="Generic.Arrays.DisallowShortArraySyntax"/>-->
<!--</rule>-->
<!--<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>-->
<!-- Rules: WordPress VIP Go, for WordPress.com VIP - see
https://github.com/Automattic/VIP-Coding-Standards -->
<rule ref="WordPress-VIP-Go">
<!-- This is not a WordPress.com VIP environment -->
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.get_page_by_path_get_page_by_path"/>
<exclude name="WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown"/>
</rule>
</ruleset>