Skip to content

Commit 160d26c

Browse files
committed
Add phpcs rules
Signed-off-by: Riddhesh Sanghvi <[email protected]>
1 parent 13b8a99 commit 160d26c

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

phpcs.xml.dist

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="EE">
3+
<description>WordPress Coding Standards for EE</description>
4+
5+
<!-- Show sniff codes in all reports, and progress while running -->
6+
<arg value="sp"/>
7+
<!-- Check all PHP files in directory tree by default. -->
8+
<arg name="extensions" value="php"/>
9+
<!-- Run different reports -->
10+
<arg name="report" value="full"/>
11+
<arg name="report" value="summary"/>
12+
<arg name="report" value="source"/>
13+
14+
<file>.</file>
15+
<exclude-pattern>*/ci/*</exclude-pattern>
16+
<exclude-pattern>*/features/*</exclude-pattern>
17+
<exclude-pattern>*/packages/*</exclude-pattern>
18+
<exclude-pattern>*/tests/*</exclude-pattern>
19+
<exclude-pattern>*/utils/*</exclude-pattern>
20+
<exclude-pattern>*/vendor/*</exclude-pattern>
21+
22+
<rule ref="PHPCompatibility">
23+
<!-- Polyfill package is used so array_column() is available for PHP 5.4- -->
24+
<exclude name="PHPCompatibility.PHP.NewFunctions.array_columnFound"/>
25+
<!-- Both magic quotes directives set in wp-settings-cli.php to provide consistent starting point. -->
26+
<exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_runtimeDeprecatedRemoved"/>
27+
<exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_sybaseDeprecatedRemoved"/>
28+
</rule>
29+
<config name="testVersion" value="7.0-"/>
30+
31+
<rule ref="WordPress-Core">
32+
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" />
33+
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar" />
34+
<exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase" />
35+
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase" />
36+
</rule>
37+
<rule ref="WordPress.Files.FileName">
38+
<properties>
39+
<property name="strict_class_file_names" value="false"/>
40+
</properties>
41+
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
42+
</rule>
43+
</ruleset>

0 commit comments

Comments
 (0)