Exclude website files from long lines check

This commit is contained in:
Zach Borboa
2021-03-20 09:48:38 -04:00
parent 7884ca4628
commit 4c20e12f5b
+1 -1
View File
@@ -74,7 +74,7 @@ if [[ ! -z "${trailing_whitespace}" ]]; then
fi
# Prohibit long lines in php files.
long_lines=$(find .. -type "f" -iname "*.php" ! -path "*/vendor/*" -exec awk '{print FILENAME":"NR" "length}' {} \; | awk '$2 > 120')
long_lines=$(find .. -type "f" -iname "*.php" ! -path "*/vendor/*" ! -path "*/www/*" -exec awk '{print FILENAME":"NR" "length}' {} \; | awk '$2 > 120')
if [[ ! -z "${long_lines}" ]]; then
result="$(echo -e "${long_lines}" | perl -pe 's/^(.*)$/Long lines found in \1/')"
echo "${result}"