Skip to content

Commit c874569

Browse files
Add a composer phpcbf command (#161)
1 parent 8324823 commit c874569

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

bin/run-phpcbf-cleanup

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
# Run the code style check only if a configuration file exists.
4+
if [ -f ".phpcs.xml" ] || [ -f "phpcs.xml" ] || [ -f ".phpcs.xml.dist" ] || [ -f "phpcs.xml.dist" ]
5+
then
6+
vendor/bin/phpcbf "$@"
7+
fi

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"homepage": "https://wp-cli.org",
99
"license": "MIT",
10-
"type" : "phpcodesniffer-standard",
10+
"type": "phpcodesniffer-standard",
1111
"require": {
1212
"php": ">=5.6",
1313
"behat/behat": "^3.7",
@@ -60,13 +60,15 @@
6060
"bin/run-behat-tests",
6161
"bin/run-linter-tests",
6262
"bin/run-php-unit-tests",
63-
"bin/run-phpcs-tests"
63+
"bin/run-phpcs-tests",
64+
"bin/run-phpcbf-cleanup"
6465
],
6566
"scripts": {
6667
"behat": "run-behat-tests",
6768
"behat-rerun": "rerun-behat-tests",
6869
"lint": "run-linter-tests",
6970
"phpcs": "run-phpcs-tests",
71+
"phpcbf": "run-phpcbf-cleanup",
7072
"phpunit": "run-php-unit-tests",
7173
"prepare-tests": "install-package-tests",
7274
"test": [

0 commit comments

Comments
 (0)