-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ruleset.xml
86 lines (74 loc) · 3.26 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WPGraphQL Strict Coding Standard" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>WPGraphQL Strict Coding Standard</description>
<rule ref="WPGraphQL-Minimum" />
<!-- The rules below are the changes from between the original sniff or parent ruleset, and what should be applied for this Standard. -->
<!-- These are disabled in WPGraphQL-Minimum but should be reenabled. -->
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter">
<severity>5</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>5</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>5</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.MultipleArguments">
<severity>5</severity>
</rule>
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.Capabilities.Undetermined">
<severity>5</severity>
</rule>
<!-- Additional commenting sniffs are in WPGraphQL-Docs -->
<rule ref="Squiz.Commenting.FunctionComment">
<!-- Enabled in WPGraphQL-Docs -->
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop" />
<exclude name="Squiz.Commenting.FunctionComment.EmptyThrows" />
<properties>
<property name="skipIfInheritdoc" value="true" />
</properties>
</rule>
<!--
Slevomat sniffs
See: https://github.com/slevomat/coding-standard/tree/master#alphabetical-list-of-sniffs
-->
<rule ref="SlevomatCodingStandard.Arrays">
<!-- Semantic sorting is a valid pattern -->
<exclude name="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys"/>
<!-- Conflicts with WPCS -->
<exclude name="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/>
</rule>
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference">
<properties>
<!-- Doesn't use PHPCompatibility-->
<property name="enableOnObjects" value="false"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch" />
<rule ref="SlevomatCodingStandard.Exceptions.DisallowNonCapturingCatch" />
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly" />
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
<properties>
<property name="caseSensitive" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses" />
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition" />
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint" />
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint" />
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint" />
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable" >
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true" />
</properties>
</rule>
</ruleset>