Skip to content

Commit 15403f0

Browse files
committed
Add php codesniffer
1 parent 0b0cc44 commit 15403f0

File tree

5 files changed

+51
-4
lines changed

5 files changed

+51
-4
lines changed

.gitattributes

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
* text=auto
2+
*.php text
3+
4+
/.github export-ignore
5+
/.phive export-ignore
6+
/tests export-ignore
7+
/.editorconfig export-ignore
8+
/.gitattributes export-ignore
9+
/.gitignore export-ignore
10+
/.travis.yml export-ignore
11+
/ahccli.plugin.zsh export-ignore
12+
/phpcs.xml.dist export-ignore
13+
/phpunit.xml.dist export-ignore

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
/.env
44
/.idea/
55
/vendor/
6+
/tools/
7+
68
composer.lock
79
*.local.*
810
clover.xml
911
coverage.xml
12+
phpcs.xml

.phive/phars.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="phpcs" version="^3.5.5" installed="3.5.5" location="./tools/phpcs" copy="false"/>
4+
<phar name="phpcbf" version="^3.5.5" installed="3.5.5" location="./tools/phpcbf" copy="false"/>
5+
</phive>

composer.json

+18-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@
33
"description": "Command line interface library for PHP",
44
"type": "library",
55
"keywords": [
6-
"php7", "command", "argv-parser", "cli", "cli-color", "cli-action", "console",
7-
"cli-writer", "argument-parser", "cli-option", "stream-output", "stream-input",
8-
"cli-app", "console-app", "php-cli"
6+
"php7",
7+
"command",
8+
"argv-parser",
9+
"cli",
10+
"cli-color",
11+
"cli-action",
12+
"console",
13+
"cli-writer",
14+
"argument-parser",
15+
"cli-option",
16+
"stream-output",
17+
"stream-input",
18+
"cli-app",
19+
"console-app",
20+
"php-cli"
921
],
1022
"license": "MIT",
1123
"authors": [
@@ -32,6 +44,8 @@
3244
},
3345
"scripts": {
3446
"test": "phpunit",
35-
"test:cov": "phpunit --coverage-text --coverage-clover coverage.xml --coverage-html vendor/cov"
47+
"test:cov": "phpunit --coverage-text --coverage-clover coverage.xml --coverage-html vendor/cov",
48+
"cs:sniff": "tools/phpcs",
49+
"cs:fix": "tools/phpcbf"
3650
}
3751
}

phpcs.xml.dist

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset>
3+
<arg value="psv"/>
4+
<arg name="extensions" value="php"/>
5+
6+
<file>src</file>
7+
<file>tests</file>
8+
9+
<exclude-pattern>/vendor/</exclude-pattern>
10+
11+
<rule ref="PSR12"/>
12+
</ruleset>

0 commit comments

Comments
 (0)