-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathphpcs.xml
59 lines (50 loc) · 2.13 KB
/
phpcs.xml
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
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
<description>Apply WordPress Coding Standards</description>
<!-- WordPress Core currently supports PHP 8.0+. -->
<config name="testVersion" value="8.0"/>
<arg name="extensions" value="php" /> <!-- Only sniff PHP files. -->
<arg name="colors" /><!-- Use colors -->
<arg value="s" /><!-- Show sniff codes in all reports. -->
<arg value="p" /><!-- Show progress. -->
<!-- Prefix globals -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="string" value="alm" />
<property name="prefixes" type="string" value="ajax_load_more" />
<property name="prefixes" type="string" value="AjaxLoadMore" />
</properties>
</rule>
<!-- I18n rules -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="string" value="ajax-load-more"/>
</properties>
</rule>
<rule ref="WordPress-Docs" />
<rule ref="PHPCompatibilityWP" />
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<rule ref="WordPress">
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.ShortPrefixPassed"/>
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<exclude name="WordPress.WP.PostsPerPage.posts_per_page_posts_per_page"/>
<exclude name="WordPress.Security.NonceVerification.Recommended" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores" />
<exclude name="Universal.Files.SeparateFunctionsFromOO.Mixed" />
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
</rule>
<!-- Exclude these files and folders -->
<exclude-pattern>/*.asset.php</exclude-pattern>
<exclude-pattern>/build/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/lang/*</exclude-pattern>
<!-- Allow . in hook names. -->
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="." />
</properties>
</rule>
</ruleset>