forked from auth0/wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml.dist
116 lines (104 loc) · 6.01 KB
/
phpcs.xml.dist
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="WP-Auth0" namespace="WPAuth0\CS\Standard">
<description>A custom coding standard for WP-Auth0</description>
<file>.</file>
<!-- Not currently checking JS or CSS -->
<exclude-pattern>/assets/*</exclude-pattern>
<!-- Tests have their own ruleset (different PHP version) -->
<exclude-pattern>/tests/*</exclude-pattern>
<!-- Dev tools only, currently -->
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- Only check PHP files. -->
<arg name="extensions" value="php"/>
<!-- Show progress, show the error codes for each message (source). -->
<arg value="sp"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="."/>
<!-- Show coloured output, if available. -->
<arg name="colors"/>
<!--
PHPCompatibility sniffs to check for PHP cross-version incompatible code.
https://github.com/PHPCompatibility/PHPCompatibility
-->
<config name="testVersion" value="7.0-"/>
<config name="minimum_supported_wp_version" value="5.4.2"/>
<rule ref="PHPCompatibilityWP"/>
<rule ref="Generic.CodeAnalysis">
<exclude name="Generic.CodeAnalysis.AssignmentInCondition"/>
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter"/>
</rule>
<rule ref="Generic.Arrays">
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found"/>
<rule ref="WordPress">
<!-- HIGH PRIORITY: security -->
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped"/>
<exclude name="WordPress.Security.EscapeOutput.UnsafePrintingFunction"/>
<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotSanitized"/>
<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotValidated"/>
<exclude name="WordPress.Security.ValidatedSanitizedInput.MissingUnslash"/>
<exclude name="WordPress.Security.NonceVerification.Missing"/>
<exclude name="WordPress.Security.NonceVerification.Recommended"/>
<!-- MEDIUM PRIORITY: PHP and WP usage -->
<exclude name="WordPress.PHP.NoSilencedErrors.Discouraged"/>
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize"/>
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize"/>
<exclude name="Squiz.PHP.NonExecutableCode.Unreachable"/>
<exclude name="WordPress.WP.AlternativeFunctions.rand_rand"/>
<exclude name="WordPress.WP.EnqueuedResources.NonEnqueuedScript"/>
<exclude name="WordPress.WP.EnqueuedResourceParameters.NotInFooter"/>
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode"/>
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/>
<exclude name="WordPress.WP.AlternativeFunctions.json_encode_json_encode"/>
<exclude name="WordPress.WP.EnqueuedResourceParameters.NoExplicitVersion"/>
<exclude name="WordPress.WP.EnqueuedResourceParameters.MissingVersion"/>
<exclude name="WordPress.PHP.StrictComparisons.LooseComparison"/>
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited"/>
<exclude name="WordPress.DateTime.RestrictedFunctions.date_date"/>
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode"/>
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode"/>
<exclude name="WordPress.PHP.DisallowShortTernary.Found"/>
<!-- LOW PRIORITY: code style, formatting, comments -->
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition"/>
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound"/>
<exclude name="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceAfterOpen"/>
<exclude name="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose"/>
<exclude name="Squiz.Scope.MethodScope.Missing"/>
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound"/>
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<exclude name="WordPress.WhiteSpace.PrecisionAlignment"/>
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="Squiz.Commenting"/>
<exclude name="Generic.Commenting"/>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="wp_auth0" />
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="wp-auth0" />
</properties>
</rule>
<rule ref="WordPress.NamingConventions">
<exclude-pattern>/examples/*</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions">
<exclude-pattern>/examples/*</exclude-pattern>
</rule>
</ruleset>