diff options
author | Davey Shafik <me@daveyshafik.com> | 2017-01-10 19:42:31 -0800 |
---|---|---|
committer | Davey Shafik <me@daveyshafik.com> | 2017-01-10 19:42:31 -0800 |
commit | 5723d3b4b29c1e8f66ae20a5393024464c6db14c (patch) | |
tree | f877222143a850c6f67184f8610c9064418d63e8 | |
parent | f97a21e6788eef7c114f8080ed2d44c798486502 (diff) | |
download | php7-mysql-shim-5723d3b4b29c1e8f66ae20a5393024464c6db14c.zip php7-mysql-shim-5723d3b4b29c1e8f66ae20a5393024464c6db14c.tar.gz php7-mysql-shim-5723d3b4b29c1e8f66ae20a5393024464c6db14c.tar.bz2 |
Add composer scripts, test and fix-cs
-rw-r--r-- | composer.json | 8 | ||||
-rwxr-xr-x | tools/fix-cs.sh | 24 |
2 files changed, 8 insertions, 24 deletions
diff --git a/composer.json b/composer.json index 9e5f0a8..2040a3d 100644 --- a/composer.json +++ b/composer.json @@ -20,5 +20,13 @@ }, "autoload": { "files": ["lib/mysql.php"] + }, + "scripts": { + "test": "phpunit", + "fix-cs": [ + "phpcbf --standard=PSR1,PSR2 ./libs ./tests", + "php-cs-fixer fix --rules=@PSR2 ./lib", + "php-cs-fixer fix --rules=@PSR2 ./tests" + ] } } diff --git a/tools/fix-cs.sh b/tools/fix-cs.sh deleted file mode 100755 index d304da3..0000000 --- a/tools/fix-cs.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -export PATH=vendor/bin:$PATH -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -if [[ $# -eq 1 ]] -then - RUNDIR=$@ -else - RUNDIR=$(cd $DIR && cd ../ && pwd)/src -fi -RESULT=$(phpcs --colors --standard=PSR1,PSR2 $RUNDIR) -echo "$RESULT" -echo $RESULT | grep "PHPCBF CAN FIX" > /dev/null -if [[ $? -eq 0 ]] -then - printf "Would you like to fix errors? [Y/n] " - read answer - if [[ $answer != "n" ]] - then - echo "Running phpcbf: " - phpcbf --standard=PSR1,PSR2 $RUNDIR - fi -fi -echo "Running php-cs-fixer: " -php-cs-fixer fix $RUNDIR --level=psr2 |