Exclude website files from long lines check

This commit is contained in:
Zach Borboa
2021-06-09 23:01:52 -04:00
parent 04bb00b4f8
commit 9447353028
+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}"