Skip to content

Commit 9ecf17f

Browse files
committed
Add ruleset
1 parent 8b3d906 commit 9ecf17f

4 files changed

Lines changed: 59 additions & 1 deletion

File tree

‎.distignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ features/
1111
utils/
1212
*.zip
1313
*.tar.gz
14+
phpcs.xml.dist
15+
phpunit.xml.dist

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ vendor/
66
*.tar.gz
77
composer.lock
88
*.log
9+
phpunit.xml
10+
phpcs.xml
11+
.phpcs.xml

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"wp-cli/wp-cli": "^2"
1616
},
1717
"require-dev": {
18-
"wp-cli/wp-cli-tests": "^2.0.7"
18+
"wp-cli/wp-cli-tests": "^2.1"
1919
},
2020
"config": {
2121
"process-timeout": 7200,

‎phpcs.xml.dist‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="WP-CLI-shell">
3+
<description>Custom ruleset for WP-CLI-shell-command</description>
4+
5+
<!--
6+
#############################################################################
7+
COMMAND LINE ARGUMENTS
8+
For help understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
9+
For help using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage
10+
#############################################################################
11+
-->
12+
13+
<!-- What to scan. -->
14+
<file>.</file>
15+
16+
<!-- Show progress. -->
17+
<arg value="p"/>
18+
19+
<!-- Strip the filepaths down to the relevant bit. -->
20+
<arg name="basepath" value="./"/>
21+
22+
<!-- Check up to 8 files simultanously. -->
23+
<arg name="parallel" value="8"/>
24+
25+
<!--
26+
#############################################################################
27+
USE THE WP_CLI_CS RULESET
28+
#############################################################################
29+
-->
30+
31+
<rule ref="WP_CLI_CS"/>
32+
33+
<!--
34+
#############################################################################
35+
PROJECT SPECIFIC CONFIGURATION FOR SNIFFS
36+
#############################################################################
37+
-->
38+
39+
<!-- For help understanding the `testVersion` configuration setting:
40+
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
41+
<config name="testVersion" value="5.4-"/>
42+
43+
<!-- Verify that everything in the global namespace is either namespaced or prefixed.
44+
See: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace -->
45+
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
46+
<properties>
47+
<property name="prefixes" type="array" extend="true">
48+
<element value="WP_CLI"/><!-- Namespaces. -->
49+
</property>
50+
</properties>
51+
</rule>
52+
53+
</ruleset>

0 commit comments

Comments
 (0)