Merge pull request #78 from zachborboa/master

Add trailing whitespace test
This commit is contained in:
Zach Borboa
2014-09-03 21:22:55 -07:00
+7
View File
@@ -1,2 +1,9 @@
find . -type "f" -iname "*.php" | xargs -L "1" php -l
trailing_whitespace=$(find . -type "f" -iname "*.php" -exec egrep --line-number -H " +$" {} \;)
if [[ ! -z "${trailing_whitespace}" ]]; then
echo -e "${trailing_whitespace}" | perl -pe 's/^(.*)$/Trailing whitespace found in \1/'
exit 1
fi
cd tests && phpunit --configuration phpunit.xml