-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
phpcs.xml
111 lines (93 loc) · 5.24 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
<?xml version="1.0"?>
<ruleset name="CiviCRM.WordPress">
<!-- Add source codes in the report. -->
<arg value="s" />
<arg name="colors" />
<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php" />
<file>.</file>
<rule ref="WordPress">
<!-- Allow slash-delimited hooks. -->
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores" />
<!-- Ignore docblock formatting. -->
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamType" />
<!-- Allow CiviCRM control structures. -->
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd" />
<!-- Allow CiviCRM file headers. -->
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag" />
<exclude name="Squiz.Commenting.FileComment.WrongStyle" />
<!-- Ignore arrow or equals alignment. -->
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<!-- Ignore file-naming conventions. -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<!-- Allow unreachable code in disabled Integration Page class for now. -->
<exclude name="Squiz.PHP.NonExecutableCode.Unreachable" />
<!-- Ignore any other rules that conflict with CiviCRM and civilint. -->
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<exclude name="Generic.Commenting.DocComment.SpacingAfter" />
<exclude name="Generic.Metrics.NestingLevel.MaxExceeded" />
<exclude name="Generic.PHP.LowerCaseConstant.Found" />
<exclude name="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceAfterOpen" />
<exclude name="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
<exclude name="Squiz.Commenting.BlockComment.HasEmptyLineBefore" />
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen" />
<exclude name="Squiz.PHP.CommentedOutCode.Found" />
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeOpen" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterOpen" />
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLineCASE" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BreakIndent" />
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
<exclude name="PEAR.Functions.FunctionCallSignature.OpeningIndent" />
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket" />
<exclude name="WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceAfterArrayOpener" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceBeforeArrayCloser" />
<exclude name="WordPress.Arrays.ArrayIndentation.ItemNotAligned" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.ArrayItemNoNewLine" />
<exclude name="WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned" />
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase" />
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" />
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped" />
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis" />
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis" />
<exclude name="WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore" />
<exclude name="WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter" />
<exclude name="WordPress.WhiteSpace.PrecisionAlignment.Found" />
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="civicrm" />
</properties>
</rule>
<!-- Allow short array syntax. -->
<rule ref="Generic.Arrays.DisallowShortArraySyntax.Found">
<severity>0</severity>
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found" />
<!-- Nesting levels. -->
<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="absoluteNestingLevel" value="5" />
</properties>
</rule>
<!-- Ignore the CiviCRM Core subdirectory when present. -->
<exclude-pattern>civicrm/civicrm/*</exclude-pattern>
<!-- Ignore the following subdirectories for now. -->
<exclude-pattern>wp-cli/*</exclude-pattern>
<exclude-pattern>wp-rest/*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
</ruleset>