From 30b9bcb76b491edded148d6077208617cbf6065e Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Fri, 19 Aug 2016 00:37:32 -0700 Subject: [PATCH] Add --color=always to grep and egrep commands --- tests/script.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/script.sh b/tests/script.sh index 0bae27f..0621b02 100755 --- a/tests/script.sh +++ b/tests/script.sh @@ -10,14 +10,14 @@ if [[ "${?}" -ne 0 ]]; then fi # Enforce line ending consistency in php files. -crlf_file=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --files-with-matches $'\r' {} \;) +crlf_file=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --files-with-matches $'\r' {} \;) if [[ ! -z "${crlf_file}" ]]; then echo "${crlf_file}" | perl -pe 's/(.*)/CRLF line terminators found in \1/' ((errors++)) fi # Enforce indentation character consistency in php files. -tab_char=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --line-number -H --perl-regexp "\t" {} \;) +tab_char=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --line-number -H --perl-regexp "\t" {} \;) if [[ ! -z "${tab_char}" ]]; then echo -e "${tab_char}" | perl -pe 's/^(.*)$/Tab character found in \1/' ((errors++)) @@ -60,7 +60,7 @@ if [[ "${TRAVIS_PHP_VERSION}" != "hhvm" ]]; then fi # Prohibit trailing whitespace in php files. -trailing_whitespace=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec egrep --line-number -H " +$" {} \;) +trailing_whitespace=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec egrep --color=always --line-number -H " +$" {} \;) if [[ ! -z "${trailing_whitespace}" ]]; then echo -e "${trailing_whitespace}" | perl -pe 's/^(.*)$/Trailing whitespace found in \1/' ((errors++)) @@ -74,7 +74,7 @@ if [[ ! -z "${long_lines}" ]]; then fi # Prohibit @author in php files. -at_author=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec egrep --line-number -H "@author" {} \;) +at_author=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec egrep --color=always --line-number -H "@author" {} \;) if [[ ! -z "${at_author}" ]]; then echo -e "${at_author}" | perl -pe 's/^(.*)$/\@author found in \1/' ((errors++))