This repository has been archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.phpcs.xml.dist
87 lines (69 loc) · 2.77 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="Yoast I18n module"
xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Yoast I18n module rules for PHP_CodeSniffer</description>
<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
#############################################################################
-->
<file>.</file>
<!-- Only check PHP files. -->
<arg name="extensions" value="php"/>
<!-- Show progress, show the error codes for each message (source). -->
<arg value="ps"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>
<!-- Cache the results between runs. -->
<arg name="cache" value="./.cache/phpcs.cache"/>
<!--
#############################################################################
USE THE YoastCS RULESET
#############################################################################
-->
<rule ref="Yoast">
<!-- Provide the plugin specific prefixes for all naming related sniffs. -->
<properties>
<property name="prefixes" type="array">
<element value="Yoast\WP\I18n"/>
<element value="yoast_i18n"/>
</property>
</properties>
<!-- Can't be helped, textdomain is passed in dynamically, that's the nature of this module. -->
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralDomain"/>
<!-- Temporary exclusion. This needs to be fixed in a major release.
While PHP is case-insensitive, the Composer autoload file isn't, so this breaks
plugins which include this module, unless the classname is also adjusted in the
plugin.
See:
- https://github.com/Yoast/i18n-module/issues/51
- https://github.com/Yoast/i18n-module/pull/29
- https://github.com/Yoast/i18n-module/pull/49 -->
<exclude name="PEAR.NamingConventions.ValidClassName.Invalid"/>
</rule>
<!--
#############################################################################
SNIFF SPECIFIC CONFIGURATION
#############################################################################
-->
<rule ref="Yoast.Files.FileName">
<properties>
<!-- Remove the following prefixes from the names of object structures. -->
<property name="oo_prefixes" type="array">
<element value="yoast"/>
</property>
</properties>
</rule>
<rule ref="Yoast.NamingConventions.NamespaceName">
<properties>
<!-- Treat the "src" directory as the project root for path to namespace translations. -->
<property name="src_directory" type="array">
<element value="src"/>
</property>
</properties>
</rule>
</ruleset>