Skip to content

Commit

Permalink
Add a composer phpcbf command (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber authored Feb 17, 2023
1 parent 8324823 commit c874569
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions bin/run-phpcbf-cleanup
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

# Run the code style check only if a configuration file exists.
if [ -f ".phpcs.xml" ] || [ -f "phpcs.xml" ] || [ -f ".phpcs.xml.dist" ] || [ -f "phpcs.xml.dist" ]
then
vendor/bin/phpcbf "$@"
fi
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"homepage": "https://wp-cli.org",
"license": "MIT",
"type" : "phpcodesniffer-standard",
"type": "phpcodesniffer-standard",
"require": {
"php": ">=5.6",
"behat/behat": "^3.7",
Expand Down Expand Up @@ -60,13 +60,15 @@
"bin/run-behat-tests",
"bin/run-linter-tests",
"bin/run-php-unit-tests",
"bin/run-phpcs-tests"
"bin/run-phpcs-tests",
"bin/run-phpcbf-cleanup"
],
"scripts": {
"behat": "run-behat-tests",
"behat-rerun": "rerun-behat-tests",
"lint": "run-linter-tests",
"phpcs": "run-phpcs-tests",
"phpcbf": "run-phpcbf-cleanup",
"phpunit": "run-php-unit-tests",
"prepare-tests": "install-package-tests",
"test": [
Expand Down

0 comments on commit c874569

Please sign in to comment.