-
Notifications
You must be signed in to change notification settings - Fork 14
/
.phpcs.xml.dist
122 lines (95 loc) · 4.11 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WPGraphQL" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>Coding standards for the WPGraphQL plugin</description>
<!-- Configure the PHP version -->
<config name="testVersion" value="7.1-" />
<!-- Check against minimum WP version. -->
<config name="minimum_supported_wp_version" value="5.0" />
<!--
Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
-->
<arg value="ps" />
<!-- Enable colors in report -->
<arg name="colors" />
<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache" value="tests/_output/cache.json" />
<!-- Check 20 files in parallel. -->
<arg name="parallel" value="20" />
<!-- Set severity to 1 to see everything that isn't effectively turned off. -->
<arg name="severity" value="1" />
<!-- Includes -->
<!--
<file>./access-functions.php</file>
<file>./activation.php</file>
<file>./deactivation.php</file>
-->
<file>./wp-graphql-smart-cache.php</file>
<file>./src</file>
<!-- Only lint php files by default -->
<arg name="extensions" value="php" />
<exclude-pattern>*/**/tests/</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="wp-graphql-smart-cache" />
</property>
</properties>
</rule>
<!-- Rules -->
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>
<!--
Prevent errors caused by WordPress Coding Standards not supporting PHP 8.0+.
See: https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
See: https://github.com/WordPress/WordPress-Coding-Standards/issues/2035#issuecomment-1325532520
-->
<ini name="error_reporting" value="E_ALL & ~E_DEPRECATED" />
<!-- Load WordPress VIP Go standards - for use with projects on the (newer) VIP Go platform. -->
<rule ref="WordPress-VIP-Go" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction"/>
<rule ref="WordPress-Core">
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<!-- Should probably not be added back -->
<exclude name="PHPCompatibility.Keywords.ForbiddenNamesAsDeclared.objectFound"/>
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/>
<!-- Should maybe Add Back Later -->
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/>
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine"/>
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments"/>
</rule>
<!-- Load WordPress Coding standards -->
<rule ref="WordPress">
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
<exclude name="WordPress.Files.FileName"/>
<!-- Definitely should not be added back -->
<exclude name="WordPress.PHP.DisallowShortTernary.Found"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.Found"/>
<!-- Should maybe Add Back Later -->
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
<!-- Should probably not be added back -->
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/>
<exclude name="WordPress.DateTime.RestrictedFunctions.date_date"/>
</rule>
<!-- Tests for inline documentation of code -->
<rule ref="WordPress-Docs">
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<!-- Should be re-enabled -->
<exclude name="Squiz.Commenting"/>
</rule>
<!-- Enforce short array syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- These formatting rules are suppressed in VIP-GO and restored here.-->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<severity>5</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>5</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine">
<severity>5</severity>
</rule>
</ruleset>