forked from wp-cli/i18n-command
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml.dist
86 lines (70 loc) · 3.19 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
<?xml version="1.0"?>
<ruleset name="WP-CLI-i18n">
<description>Custom ruleset for WP-CLI I18n-command</description>
<!--
#############################################################################
COMMAND LINE ARGUMENTS
For help understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
For help using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage
#############################################################################
-->
<!-- What to scan. -->
<file>.</file>
<!-- Ignoring select files/folders.
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders -->
<exclude-pattern>*/tests/data/*</exclude-pattern>
<!-- Show progress. -->
<arg value="p"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>
<!--
#############################################################################
USE THE WP_CLI_CS RULESET
#############################################################################
-->
<rule ref="WP_CLI_CS"/>
<!--
#############################################################################
PROJECT SPECIFIC CONFIGURATION FOR SNIFFS
#############################################################################
-->
<!-- For help understanding the `testVersion` configuration setting:
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="5.6-"/>
<!-- Verify that everything in the global namespace is either namespaced or prefixed.
See: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="WP_CLI\I18n"/><!-- Namespaces. -->
<element value="wpcli_i18n"/><!-- Global variables and such. -->
</property>
</properties>
</rule>
<!-- Whitelist method names for classes that extend a PSR-2 package. -->
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<exclude-pattern>*/src/IterableCodeExtractor\.php$</exclude-pattern>
</rule>
<!-- Whitelist property name for a a JSON-decoded object. -->
<rule ref="WordPress.NamingConventions.ValidVariableName">
<properties>
<property name="allowed_custom_properties" type="array">
<element value="sourcesContent"/>
<element value="functionsScannerClass"/>
</property>
</properties>
</rule>
<!-- Allow for JavaScript format examples to be provided in comments.
See: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties#squizphpcommentedoutcode -->
<rule ref="Squiz.PHP.CommentedOutCode">
<properties>
<property name="maxPercentage" value="45"/>
</properties>
</rule>
<!-- Whitelist method names for classes that extend a PSR-2 package. -->
<rule ref="WordPress.DateTime.RestrictedFunctions.date_date">
<exclude-pattern>*/src/MakePotCommand\.php$</exclude-pattern>
</rule>
</ruleset>