-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml.dist
155 lines (129 loc) · 6.32 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?xml version="1.0"?>
<ruleset name="Nuki for WordPress">
<description>Coding standards for Nuki for WordPress</description>
<arg name="extensions" value="php,js" />
<arg name="colors"/>
<arg value="ps"/>
<file>.</file>
<config name="minimum_supported_wp_version" value="4.7"/>
<rule ref="PHPCompatibilityWP">
<config name="testVersion" value="5.6-"/>
</rule>
<rule ref="WordPressVIPMinimum">
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude name="WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.flush_rewrite_rules_flush_rewrite_rules"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.term_exists_term_exists"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_delete_user_meta"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_get_user_meta"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_update_user_meta"/>
<exclude name="WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE"/>
</rule>
<rule ref="WordPress">
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning"/>
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found"/>
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/>
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound"/>
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.Found"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInTernaryCondition"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/>
<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery"/>
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching"/>
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_key"/>
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_tax_query"/>
<exclude name="WordPress.Files.FileName"/>
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode" />
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" />
<exclude name="WordPress.PHP.StrictComparisons.LooseComparison" />
<exclude name="WordPress.WP.EnqueuedResources.NonEnqueuedScript" />
<exclude name="WordPress.WP.EnqueuedResourceParameters.NotInFooter" />
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited" />
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get" />
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="connect-your-nuki-smartlock"/>
</property>
</properties>
</rule>
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable" >
<exclude-pattern>/load.php</exclude-pattern>
<exclude-pattern>/view-*</exclude-pattern>
</rule>
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable" >
<properties>
<property name="allowUnusedVariablesBeforeRequire" value="true"/>
</properties>
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.Missing" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.Missing" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamComment" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.VariableComment.Missing" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidHookName.UseUnderscores" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.NoSilencedErrors.Discouraged" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Security" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- PHPCS cannot correctly parse JavaScript syntax -->
<rule ref="PEAR.Functions.FunctionCallSignature">
<exclude-pattern>*/*.js</exclude-pattern>
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<exclude-pattern>*/*.js</exclude-pattern>
</rule>
<!-- These rules are not suited for JSX code -->
<rule ref="WordPress.WhiteSpace.OperatorSpacing">
<exclude-pattern>*/block-editor/js/*</exclude-pattern>
</rule>
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<exclude-pattern>*/block-editor/js/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<exclude-pattern>*/tests/phpunit/tests/modules/FullSiteEditing/TestCaseTrait.php</exclude-pattern>
<exclude-pattern>*/tests/phpunit/tests/TestCaseTrait.php</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase">
<exclude-pattern>*/tests/phpunit/tests/modules/FullSiteEditing/TestCaseTrait.php</exclude-pattern>
<exclude-pattern>*/tests/phpunit/tests/TestCaseTrait.php</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase">
<exclude-pattern>*/tests/phpunit/tests/modules/FullSiteEditing/TestCaseTrait.php</exclude-pattern>
<exclude-pattern>*/tests/phpunit/tests/TestCaseTrait.php</exclude-pattern>
</rule>
<rule ref="WordPress.Security.ValidatedSanitizedInput">
<properties>
<property name="customSanitizingFunctions" type="array">
<element value="wp_verify_nonce"/>
</property>
</properties>
</rule>
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>tmp/*</exclude-pattern>
<exclude-pattern>webpack.config.js</exclude-pattern>
<!-- Because files are built with Webpack/babel. It doesn't make sense to scan these files -->
<exclude-pattern>js/build/*</exclude-pattern>
</ruleset>