forked from acobster/wp-yaml-fixtures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
132 lines (108 loc) · 5.5 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
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
<?xml version="1.0"?>
<ruleset name="WordPress-Timber">
<description>A custom set of rules to check coding standards for Timber.</description>
<arg name="tab-width" value="2" />
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />
<!--
Default settings for command line usage
-->
<!-- Exclude folders and files from being checked. -->
<exclude-pattern>wp-content/</exclude-pattern>
<exclude-pattern>wp/</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<!-- If no files or directories are specified on the command line, check all relevant files. -->
<file>./lib</file>
<!-- Use colors in output. -->
<arg name="colors"/>
<!-- Show sniff names and progress. -->
<arg value="sp"/>
<!--
WordPress-Extra
Best practices beyond core WordPress Coding Standards.
The WordPress-Core standard doesn’t have to be included here,
because WordPress-Extra already includes it.
-->
<rule ref="WordPress-Extra">
<!-- Do not check for proper WordPress file names. -->
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
<exclude name="PEAR.Functions.FunctionCallSignature" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BreakIndent" />
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag" />
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
<exclude name="Squiz.Commenting.InlineComment.SpacingBefore" />
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen" />
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpenHint" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceAfterArrayOpener" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceBeforeArrayCloser" />
<exclude name="WordPress.Arrays.ArrayIndentation.ItemNotAligned" />
<exclude name="WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned" />
<exclude name="WordPress.Arrays.ArrayKeySpacingRestrictions" />
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.StringNotSnakeCase" />
<exclude name="WordPress.PHP.YodaConditions" />
<exclude name="WordPress.WhiteSpace.ArbitraryParenthesesSpacing.SpaceAfterOpen" />
<exclude name="WordPress.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose" />
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis" />
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis" />
<exclude name="WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter" />
<exclude name="WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore" />
<exclude name="WordPress.WhiteSpace.PrecisionAlignment" />
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing">
<exclude-pattern>/test/</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.Missing">
<exclude-pattern>/test/</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.VariableComment.Missing">
<exclude-pattern>/test/</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>/test/bootstrap.php</exclude-pattern>
</rule>
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
<!--
WordPress-Docs
WordPress Coding Standards for Inline Documentation and Comments.
-->
<rule ref="WordPress-Docs" />
<!--
File Names
The WordPress Coding Standards state that all class files should start with 'class-'. Timber
follows the PSR-0 standard for naming class files, because it uses autoloading via Composer.
@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#disregard-class-file-name-rules
-->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false" />
</properties>
</rule>
<!--
Hook Names
While the WordPress Coding Standards state that hook names should be separated by
underscores, an optionated approach used by plugins like Advanced Custom Fields is to use
'/' to namespace hooks.
@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#custom-word-delimiters-in-hook-names
-->
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="/"/>
</properties>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="requiredSpacesAfterOpen" value="0" />
<property name="requiredSpacesBeforeClose" value="0"/>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="exact" value="false"/>
<property name="indent" value="2"/>
<property name="tabIndent" value="false"/>
<property name="ignoreIndentationTokens" type="array" value="T_HEREDOC,T_NOWDOC,T_INLINE_HTML"/>
</properties>
</rule>
</ruleset>