-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpcs.xml
62 lines (52 loc) · 2.24 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
60
61
62
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Choose Your Best Selling Products">
<!-- WordPress Core Rules -->
<rule ref="WordPress-Core">
<!-- Short array syntax is widely accepted now -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<!--<exclude name="Generic.PHP.DisallowShortTernary" />-->
</rule>
<!-- Include WordPress Documentation Rules -->
<rule ref="WordPress-Docs">
<!-- We will exclude the assets and vendor folders from being checked -->
<exclude-pattern>assets/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
</rule>
<!-- Include Extra WordPress-Specific Rules -->
<rule ref="WordPress-Extra" />
<!-- Ensure correct use of internationalization functions -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="cbsp"/>
<element value="default"/>
</property>
</properties>
</rule>
<!-- Ensure PascalCase for Class Files -->
<rule ref="Squiz.Classes.ClassFileName">
<include-pattern>includes/*</include-pattern>
</rule>
<!-- Allow TestCase and DataProvider to not follow lowercase file naming -->
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>tests/php/TestCase.php</exclude-pattern>
<exclude-pattern>tests/php/DataProvider.php</exclude-pattern>
</rule>
<!-- Limit consecutive blank lines to 1 instead of 2 -->
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
<property name="spacingBeforeFirst" value="1" />
<property name="spacingAfterLast" value="0" />
</properties>
</rule>
<!-- Set up PHP CodeSniffer arguments -->
<arg value="s" />
<arg name="extensions" value="php" />
<file>.</file>
<!-- Exclude common directories from being scanned -->
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern type="relative">assets/build/*</exclude-pattern>
</ruleset>