Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Cleaning up CS fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Apr 18, 2013
1 parent 1a1b722 commit 4349c8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
25 changes: 14 additions & 11 deletions bin/check-cs.sh
Original file line number Diff line number Diff line change
@@ -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";
6 changes: 1 addition & 5 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,7 @@
error="${basedir}/build/cs-results/check-cs.log"
failonerror="true"
append="true"
>
<arg value="-c" />
<arg value="${basedir}/tests/phpunit.xml.dist" />
<arg value="${basedir}/tests/ZendTest/@{component}" />
</exec>
/>
</sequential>
</macrodef>
</project>

0 comments on commit 4349c8d

Please sign in to comment.