-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.ruleset.xml
49 lines (42 loc) · 2.47 KB
/
phpcs.ruleset.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
<?xml version="1.0"?>
<ruleset xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>
<!-- Use the WordPress standards unless there is a good reason not to. Where WordPress doesn't specify,
fall back on PSR2.
There are a number of places where we must NOT use the WordPress standards.
1) Class name/File name convensions break PSR2 autoloaders.
2) Given we're not following the class naming convensions, we wont follow the variable names either
This also means its really obvious which bits of code are ours, and when we're calling part of WP_Core.
-->
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/features/*</exclude-pattern>
<exclude-pattern>*-display*</exclude-pattern>
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />
<rule ref="WordPress-Core" >
<exclude name="PEAR.NamingConventions.ValidClassName"/>
<exclude name="WordPress.Files.FileName"/>
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/>
</rule>
<!-- All these exclusions are directly contradicted by the WordPress standards. -->
<rule ref="PSR2">
<exclude name="Generic.WhiteSpace.DisallowTabIndent" />
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen" />
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
<exclude name="PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket" />
<exclude name="PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket" />
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine" />
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpaceBeforeCloseBrace" />
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.Indent" />
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
</rule>
<!--
<rule ref="WordPress-Docs" />
<rule ref="WordPress-Extra" /> -->
</ruleset>