-
Notifications
You must be signed in to change notification settings - Fork 3
/
phpcs.xml
99 lines (74 loc) · 3.3 KB
/
phpcs.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
87
88
89
90
91
92
93
94
95
96
97
98
99
<?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>./plugin.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-gutenberg" />
</property>
</properties>
</rule>
<!-- Rules -->
<!-- Load PHPCompatibilityWP standards -->
<rule ref="PHPCompatibilityWP" />
<!-- 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"/>
</ruleset>