From 4349c8d273fe39cbcfc249d1faff52833e75a172 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 18 Apr 2013 22:10:47 +0200 Subject: [PATCH] Cleaning up CS fixer --- bin/check-cs.sh | 25 ++++++++++++++----------- build.xml | 6 +----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/bin/check-cs.sh b/bin/check-cs.sh index 6cc200f780e..b76cef024e3 100755 --- a/bin/check-cs.sh +++ b/bin/check-cs.sh @@ -1,17 +1,20 @@ #!/bin/bash cd "$(dirname $(dirname "$0"))" -output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 .) -echo $output -cs=0 -if [[ "$output" -ne "" ]];then - cs=2 -fi -echo "Coding standards exited with status $cs" +libraryCS=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 ./library/) +testsCS=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 ./tests/) + +output="$libraryCS +$testsCS" -if [[ "$cs" -eq "2" ]];then - echo "Exiting with status 2 due to CS"; - exit 2; +if [[ "$output" ]]; +then + echo -en '\E[31m'"$output\033[1m\033[0m"; + printf "\n"; + echo -en '\E[31;47m'"\033[1mCoding standards check failed!\033[0m" # Red + printf "\n"; + exit 2; fi -exit 0 +echo -en '\E[32m'"\033[1mCoding standards check passed!\033[0m" # Green +printf "\n"; diff --git a/build.xml b/build.xml index 8f47d6954ab..6bc21a24aa8 100644 --- a/build.xml +++ b/build.xml @@ -136,11 +136,7 @@ error="${basedir}/build/cs-results/check-cs.log" failonerror="true" append="true" - > - - - - + /> \ No newline at end of file