Add check to prohibit excessively long lines in php files

This commit is contained in:
Zach Borboa
2015-08-20 02:37:11 -07:00
parent f10ca99e59
commit 29afe450f8
+7
View File
@@ -63,3 +63,10 @@ if [[ ! -z "${trailing_whitespace}" ]]; then
echo -e "${trailing_whitespace}" | perl -pe 's/^(.*)$/Trailing whitespace found in \1/'
exit 1
fi
# Prohibit long lines in php files.
long_lines=$(find . -type "f" -iname "*.php" -exec awk '{print FILENAME":"NR" "length}' {} \; | awk '$2 > 120')
if [[ ! -z "${long_lines}" ]]; then
echo -e "${long_lines}" | perl -pe 's/^(.*)$/Long lines found in \1/'
exit 1
fi