-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpcs.xml.dist
70 lines (62 loc) · 2.28 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
<?xml version="1.0"?>
<ruleset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"
name="PHP Coding Standards"
>
<description>PHP Coding Standards for modern WordPress plugin</description>
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="tab-width" value="4"/>
<!-- Ignore warnings, show progress of the run and show sniff names -->
<arg value="nps"/>
<!-- The directories to apply the rules -->
<file>scoper.inc.php</file>
<file>uninstall.php</file>
<file>plugin-name.php</file>
<file>./app</file>
<file>./inc</file>
<!-- Show the warning but exit with 0. The Warning is fine -->
<config name="ignore_warnings_on_exit" value="1"/>
<!-- Check for cross-version support for WordPress 5.8 or higher. -->
<config name="minimum_wp_version" value="5.8"/>
<!-- Check for cross-version support for PHP 7.4 or higher. Requires PHPCompatibilityWP -->
<config name="testVersion" value="7.4-"/>
<!-- Rulesets -->
<rule ref="SyntatisWP"/>
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array">
<element key="app" value="PluginName"/>
</property>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="plugin-name"/>
</property>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="exact" value="false"/>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
<property name="ignoreIndentationTokens" type="array">
<element value="T_HEREDOC"/>
<element value="T_NOWDOC"/>
<element value="T_INLINE_HTML"/>
</property>
</properties>
</rule>
<rule ref="PHPCompatibilityWP"/>
<!-- Exclude files -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing">
<exclude-pattern>/inc/bootstrap/providers.php</exclude-pattern>
<exclude-pattern>/inc/config/*.php</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName">
<exclude-pattern>/inc/bootstrap/providers.php</exclude-pattern>
</rule>
</ruleset>