forked from alleyinteractive/apple-news
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpcs.xml
73 lines (60 loc) · 2.65 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Publish to Apple News" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>PHP_CodeSniffer standard for Publish to Apple News.</description>
<!-- Include Alley Rules -->
<rule ref="Alley-Interactive" />
<!-- Check for cross-version support for PHP 7.4 and higher. -->
<config name="testVersion" value="8.0-"/>
<!-- Set the text domain for i18n. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="apple-news" />
</properties>
</rule>
<!-- Set the prefixes for functions etc. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="apple_,Apple_,Admin_Apple_" />
</properties>
</rule>
<!-- This plugin uses DOMDocument and related functions extensively, so allow their property names. -->
<rule ref="WordPress.NamingConventions.ValidVariableName">
<properties>
<property name="allowed_custom_properties" type="array">
<element value="childNodes" />
<element value="firstChild" />
<element value="isDefault" />
<element value="keyPath" />
<element value="nodeName" />
<element value="nodeType" />
<element value="nodeValue" />
<element value="ownerDocument" />
<element value="tagName" />
</property>
</properties>
</rule>
<!-- PHPUnit uses files that start with "test-" and contain classes, which conflicts with this rule. -->
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>tests/</exclude-pattern>
</rule>
<!--
Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
-->
<arg value="ps" />
<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache" value=".phpcs-cache.json" />
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./" />
<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20" />
<!-- Set severity to 1 to see everything that isn't effectively turned off. -->
<arg name="severity" value="1" />
<!-- Exclude a few directories and autogenerated files. -->
<exclude-pattern>build/</exclude-pattern>
<exclude-pattern>node_modules/</exclude-pattern>
<exclude-pattern>vendor/</exclude-pattern>
<!-- The version set here matches the minimum version in readme.txt. -->
<config name="minimum_wp_version" value="6.3" />
</ruleset>