From 1ef006f75155cf0c0dcb8812e96035a5973ae350 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Tue, 10 Nov 2015 17:36:05 -0800 Subject: [PATCH] Prohibit screaming caps notation in php files --- tests/script.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/script.sh b/tests/script.sh index c911357..4e298bb 100755 --- a/tests/script.sh +++ b/tests/script.sh @@ -77,3 +77,10 @@ if [[ ! -z "${at_author}" ]]; then echo -e "${at_author}" | perl -pe 's/^(.*)$/\@author found in \1/' exit 1 fi + +# Prohibit screaming caps notation in php files. +caps=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec egrep --color=always --line-number -H -e "FALSE[^']" -e "NULL" -e "TRUE" {} \;) +if [[ ! -z "${caps}" ]]; then + echo -e "${caps}" | perl -pe 's/^(.*)$/All caps found in \1/' + exit 1 +fi