-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathruleset.xml
116 lines (101 loc) · 6.06 KB
/
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
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
<?xml version="1.0"?>
<ruleset name="Purgely">
<description>A slightly modified set of WordPress rules for the Purgely plugin</description>
<rule ref="WordPress-Core" />
<!--
This is taken directly from WordPress' core doc standards and some adjustments have been made. Customizations are
noted where appropriate
-->
<rule ref="Squiz.Commenting">
<!-- Custom -->
<!-- We want class comments, but this rule does not work without a file comment. Remove the noise. -->
<exclude name="Squiz.Commenting.ClassComment.Missing" />
<!-- End Custom -->
<!-- Diversions from core -->
<exclude name="Squiz.Commenting.FileComment" />
<!-- Things in WP that are excluded
<exclude name="Squiz.Commenting.BlockComment.FirstLineIndent"/>
<exclude name="Squiz.Commenting.ClassComment.TagNotAllowed"/>
<exclude name="Squiz.Commenting.DocCommentAlignment.SpaceAfterStar"/>
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamName"/>
<exclude name="Generic.Commenting.DocComment.ParamGroup"/>
<exclude name="Generic.Commenting.Todo.CommentFound"/>
<exclude name="Generic.Commenting.Todo.TaskFound"/>
-->
<!-- End diversions from core -->
<!-- Excluded to allow /* translators: ... */ comments -->
<exclude name="Squiz.Commenting.BlockComment.SingleLine"/>
<!-- Sniff seems to require indenting with spaces -->
<exclude name="Squiz.Commenting.BlockComment.LineIndent"/>
<!-- Sniff seems to require indenting with spaces -->
<exclude name="Squiz.Commenting.BlockComment.LastLineIndent"/>
<!-- WP requires /** for require() et al. See https://github.com/squizlabs/PHP_CodeSniffer/pull/581 -->
<exclude name="Squiz.Commenting.BlockComment.WrongStart"/>
<!-- WP handbook doesn't clarify one way or another, so ignore -->
<exclude name="Squiz.Commenting.BlockComment.NoEmptyLineAfter"/>
<!-- WP doesn't require //end ... for classes and functions -->
<exclude name="Squiz.Commenting.ClosingDeclarationComment.Missing"/>
<!-- WP doesn't require a @author value for Squiz -->
<exclude name="Squiz.Commenting.FileComment.IncorrectAuthor"/>
<!-- WP doesn't require a @copyright value for Squiz -->
<exclude name="Squiz.Commenting.FileComment.IncorrectCopyright"/>
<!-- WP doesn't require @author tags -->
<exclude name="Squiz.Commenting.FileComment.MissingAuthorTag"/>
<!-- WP doesn't require @subpackage tags -->
<exclude name="Squiz.Commenting.FileComment.MissingSubpackageTag"/>
<!-- WP doesn't require @copyright tags -->
<exclude name="Squiz.Commenting.FileComment.MissingCopyrightTag"/>
<!-- WP has a different prefered order of tags -->
<exclude name="Squiz.Commenting.FileComment.PackageTagOrder"/>
<!-- WP has a different prefered order of tags -->
<exclude name="Squiz.Commenting.FileComment.SubpackageTagOrder"/>
<!-- WP has a different prefered order of tags -->
<exclude name="Squiz.Commenting.FileComment.AuthorTagOrder"/>
<!-- WP has a different prefered order of tags -->
<exclude name="Squiz.Commenting.FileComment.CopyrightTagOrder"/>
<!-- WP prefers int and bool instead of integer and boolean -->
<exclude name="Squiz.Commenting.FunctionComment.IncorrectParamVarName"/>
<!-- WP prefers int and bool instead of integer and boolean -->
<exclude name="Squiz.Commenting.FunctionComment.InvalidReturn"/>
<!-- WP prefers indicating a @return null for early returns -->
<exclude name="Squiz.Commenting.FunctionComment.InvalidReturnNotVoid"/>
<!-- WP states not all functions require @return -->
<exclude name="Squiz.Commenting.FunctionComment.MissingReturn"/>
<!-- Excluded to allow param documentation for arrays -->
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentNotCapital"/>
<!-- WP doesn't require type hints -->
<exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/>
<!-- Exclude to allow duplicate hooks to be documented -->
<exclude name="Squiz.Commenting.InlineComment.DocBlock"/>
<!-- Not in Inline Docs standard, and a code smell -->
<exclude name="Squiz.Commenting.LongConditionClosingComment"/>
<!-- Not in Inline Docs standard, and needed to bypass WPCS checks -->
<exclude name="Squiz.Commenting.PostStatementComment"/>
<!-- WP prefers int and bool instead of integer and boolean -->
<exclude name="Squiz.Commenting.VariableComment.IncorrectVarType"/>
<!-- WP demands a @since tag for class variables -->
<exclude name="Squiz.Commenting.VariableComment.TagNotAllowed"/>
<!-- WP prefers @since first -->
<exclude name="Squiz.Commenting.VariableComment.VarOrder"/>
</rule>
<rule ref="Generic.Commenting">
<!-- WP has different alignment of tag values -->
<exclude name="Generic.Commenting.DocComment.TagValueIndent"/>
<!-- WP prefers no empty line between @param tags and @return -->
<exclude name="Generic.Commenting.DocComment.NonParamGroup"/>
<!-- Excluded to allow param documentation for arrays -->
<exclude name="Generic.Commenting.DocComment.TagsNotGrouped"/>
<!-- Exclude to allow duplicate hooks to be documented -->
<exclude name="Generic.Commenting.DocComment.ContentAfterOpen"/>
<!-- Exclude to allow duplicate hooks to be documented -->
<exclude name="Generic.Commenting.DocComment.SpacingBeforeShort"/>
<!-- Exclude to allow duplicate hooks to be documented -->
<exclude name="Generic.Commenting.DocComment.ContentBeforeClose"/>
<exclude name="Generic.Commenting.DocComment.ParamNotFirst"/>
</rule>
<rule ref="WordPress-Extra" />
<rule ref="WordPress-VIP">
<exclude name="WordPress.VIP.RestrictedFunctions.get_term_link" />
<exclude name="WordPress.VIP.RestrictedFunctions.url_to_postid" />
</rule>
</ruleset>