-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
117 lines (87 loc) · 4.12 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
<?xml version="1.0"?>
<ruleset name="Pressmodo PHPCS">
<description>Pressmodo PHPCS extended.</description>
<config name="installed_paths" value="./../../wp-coding-standards/wpcs,./../../phpcsstandards/phpcsutils,./../../phpcsstandards/phpcsextra"/>
<exclude-pattern>*/phpunit.xml*</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
<!-- Third-party code -->
<exclude-pattern>*/bower-components/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<!-- Ensure certain file types aren't sniffed -->
<exclude-pattern>*\.(css|js)</exclude-pattern>
<!-- Don't worry about files that don't contain any code -->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
<!-- Ignore mixed line-endings warnings -->
<rule ref="Internal.LineEndings.Mixed">
<severity>0</severity>
</rule>
<!-- Internal exceptions (often occur on minified files) -->
<rule ref="Internal.Tokenizer.Exception">
<severity>0</severity>
</rule>
<!-- For CI, don't fail on warnings -->
<config name="ignore_warnings_on_exit" value="1"/>
<rule ref="WordPress-Core">
<!-- Array adjustments -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax" />
<exclude name="WordPress.Arrays.CommaAfterArrayItem.NoComma" />
<!-- Allow short ternary -->
<exclude name="Universal.Operators.DisallowShortTernary" />
<!-- Don't use class-*.php filenames -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<!-- Don't force yoda conditions -->
<exclude name="WordPress.PHP.YodaConditions" />
<!-- We can handle clever code -->
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/>
</rule>
<!-- Enforce doc standards -->
<rule ref="WordPress-Docs">
<!-- Don't worry about capitolizing long lines -->
<exclude name="Generic.Commenting.DocComment.LongNotCapital"/>
<!-- Dont need to capitalize first letter -->
<exclude name="Generic.Commenting.DocComment.ShortNotCapital"/>
</rule>
<rule ref="WordPress-Extra">
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
<!-- Forget about file names -->
<exclude name="WordPress.Files.FileName"/>
<!-- Don't require punctuation after inline comments -->
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<!-- Allow empty catch statements -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
<!-- Comment punctuation doesn't matter -->
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.VariableComment.Missing"/>
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<!-- Ignore yoda conditions -->
<exclude name="WordPress.PHP.YodaConditions" />
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid" />
</rule>
<!-- Sets the minimum supported WP version to 4.7, which is over a year old. -->
<config name="minimum_supported_wp_version" value="6.5" />
<!-- Make missing translator comment a warning. -->
<rule ref="WordPress.WP.I18n.MissingTranslatorsComment">
<type>warning</type>
</rule>
<!-- Sometimes we need to override globals -->
<rule ref="WordPress.WP.GlobalVariablesOverride.OverrideProhibited">
<type>warning</type>
</rule>
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
<!-- Disallow long array syntax. -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<!-- Only check the PHP files. -->
<arg name="extensions" value="php"/>
</ruleset>