-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.tests.xml
More file actions
68 lines (55 loc) · 3.61 KB
/
Copy pathphpcs.tests.xml
File metadata and controls
68 lines (55 loc) · 3.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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
<description>Coding Standards for Tests</description>
<!-- Inspect files in the /tests folder -->
<file>tests</file>
<!-- Exclude TestsTrait.php: it is a verbatim copy of the PHP SDK's
TestsTrait.php (PSR-12 style, snake_case handled by API contract).
Running WordPress coding standards on it produces hundreds of
false positives and would force the file to diverge from its SDK
master copy, defeating the copy-paste workflow. -->
<exclude-pattern>tests/Integration/TestsTrait.php</exclude-pattern>
<!-- Run in verbose mode and specify the precise rule that failed in output -->
<arg value="sv"/>
<arg name="colors"/>
<!-- Check that code meets WordPress-Extra standards. -->
<rule ref="WordPress-Extra">
<!-- Don't use yoda conditions -->
<exclude name="WordPress.PHP.YodaConditions" />
<!-- File and variable naming conventions in Codeception differ from WordPress -->
<exclude name="WordPress.NamingConventions" />
<exclude name="WordPress.Files.FileName" />
<!-- Class and function braces and spacing in Codeceptoin differs from WordPress -->
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis" />
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceAfterCloseParenthesis" />
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen" />
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose" />
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis" />
<exclude name="Generic.Classes.OpeningBraceSameLine.BraceOnNewLine" />
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine" />
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket" />
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction" />
<!-- _before() and _passed() must use underscores in Codeception -->
<exclude name="PSR2.Methods.MethodDeclaration.Underscore" />
<!-- Permit [] instead of array() -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
<!-- Permit $fn instead of $function -->
<exclude name="Universal.NamingConventions.NoReservedKeywordParameterNames.fnFound" />
<!-- We might use some datetime functions for tests -->
<exclude name="WordPress.DateTime.RestrictedFunctions" />
<!-- Handles false positives where Coding Standards thinks we did something wrong when we're just checking for e.g. a stylesheet -->
<exclude name="WordPress.WP.EnqueuedResources" />
<exclude name="WordPress.PHP.DiscouragedPHPFunctions" />
<exclude name="WordPress.WP.CapitalPDangit.MisspelledInText" />
</rule>
<!-- Check that code is documented to WordPress Standards. -->
<rule ref="WordPress-Docs">
<!-- File document level comments are useless for tests; we know what a test suite does -->
<exclude name="Squiz.Commenting.FileComment.Missing" />
</rule>
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
</ruleset>