-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
executable file
·99 lines (98 loc) · 5.61 KB
/
phpcs.xml
File metadata and controls
executable file
·99 lines (98 loc) · 5.61 KB
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
<?xml version="1.0"?>
<ruleset name="WP2Static">
<description>WP2Static Project Coding Standard</description>
<config name="testVersion" value="7.2-"/>
<!--
Note: Applied WP standard override to allow tabs instead
of spaces, however, PHP CBF is using 4 spaces - Gray
Reference: https://stackoverflow.com/a/45154669/3701444
-->
<arg name="colors" />
<arg name="tab-width" value="2" />
<!-- Custom line length validation -->
<rule ref="Squiz.PHP.DiscouragedFunctions" />
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="100" />
<property name="absoluteLineLimit" value="120" />
</properties>
</rule>
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2" />
<property name="tabIndent" value="false" />
</properties>
</rule>
<rule ref="Squiz.Commenting">
<exclude name="Squiz.Commenting.ClassComment"/>
<exclude name="Squiz.Commenting.FileComment"/>
<exclude name="Squiz.Commenting.FunctionComment"/>
<exclude name="Squiz.Commenting.VariableComment"/>
<exclude name="Squiz.Commenting.LongConditionClosingComment"/>
</rule>
<rule ref="WordPress">
<exclude name="Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed" />
<exclude name="Generic.Commenting.DocComment.ShortNotCapital" />
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine" />
<exclude name="Generic.PHP.NoSilencedErrors.Discouraged" />
<exclude name="Generic.Strings.UnnecessaryStringConcat.Found" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
<exclude name="PSR2.Methods.MethodDeclaration.Underscore" />
<exclude name="Squiz.Commenting.ClassComment.Missing" />
<exclude name="Squiz.Commenting.FileComment.Missing" />
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop" />
<exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop" />
<exclude name="Squiz.Commenting.FunctionCommentThrowTag" />
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
<exclude name="Squiz.Commenting.LongConditionClosingComment.SpacingBefore" />
<exclude name="Squiz.Commenting.PostStatementComment.Found" />
<exclude name="Squiz.Commenting.VariableComment.Missing" />
<exclude name="Squiz.PHP.CommentedOutCode.Found" />
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterOpen" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterEnd" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeOpen" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd" />
<exclude name="Squiz.PHP.NonExecutableCode.Unreachable" />
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.Found" />
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition" />
<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery" />
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching" />
<exclude name="WordPress.DB.DirectDatabaseQuery.SchemaChange" />
<exclude name="WordPress.DB.PreparedSQL" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid" />
<exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar" />
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace" />
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_error_log" />
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_print_r" />
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_var_export" />
<exclude name="WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_error_reporting" />
<exclude name="WordPress.PHP.DiscouragedPHPFunctions" />
<!-- TODO: refactor to eliminate use of `exec` for compatibility w/shared hosts -->
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.system_calls_exec" />
<!-- TODO: refactor to eliminate use of `shell_exec` for compat w/shared hosts -->
<exclude name="WordPress.PHP.DontExtract.extract_extract" />
<exclude name="WordPress.PHP.StrictComparisons.LooseComparison" />
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" />
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
<!-- Forcing exceptions to be escaped is bad practice.
See: https://github.com/WordPress/WordPress-Coding-Standards/issues/2374 -->
<exclude name="WordPress.Security.EscapeOutput.ExceptionNotEscaped"/>
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped" />
<exclude name="WordPress.Security.NonceVerification" />
<exclude name="WordPress.Security.ValidatedSanitizedInput" />
<exclude name="WordPress.WP.AlternativeFunctions" />
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
</ruleset>