-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
58 lines (48 loc) · 2.23 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPress Coding Standards for Plugins" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>WordPress Coding Standards for Plugins</description>
<!-- Exclude some directories. -->
<exclude-pattern>/.scripts/*</exclude-pattern>
<exclude-pattern>/.wordpress-org/*</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- Exclude minified Javascript files. -->
<exclude-pattern>*.min.js</exclude-pattern>
<!-- Exclude traits from the PHP SDK. -->
<exclude-pattern>class-convertkit-api-traits.php</exclude-pattern>
<!-- Check that code meets WordPress-Extra standards. -->
<rule ref="WordPress-Extra">
<!--
We may want a middle ground though. The best way to do this is add the
entire ruleset, then rule by rule, remove ones that don't suit a project.
We can do this by running `phpcs` with the '-s' flag, which allows us to
see the names of the sniffs reporting errors.
Once we know the sniff names, we can opt to exclude sniffs which don't
suit our project like so.
The below two examples just show how you can exclude rules.
They are not intended as advice about which sniffs to exclude.
-->
<!--
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing"/>
<exclude name="WordPress.Security.EscapeOutput"/>
-->
<exclude name="WordPress.PHP.YodaConditions" />
<exclude name="PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose" />
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody" />
</rule>
<!-- Check that code is documented to WordPress Standards. -->
<rule ref="WordPress-Docs"/>
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
<!-- Define minimum supported WordPress version for sniffs. -->
<config name="minimum_supported_wp_version" value="5.0"/>
<!-- Text domain should always be 'convertkit'. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="convertkit"/>
</property>
</properties>
</rule>
</ruleset>