Skip to content

Commit 29afe45

Browse files
committed
Add check to prohibit excessively long lines in php files
1 parent f10ca99 commit 29afe45

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/script.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,10 @@ if [[ ! -z "${trailing_whitespace}" ]]; then
6363
echo -e "${trailing_whitespace}" | perl -pe 's/^(.*)$/Trailing whitespace found in \1/'
6464
exit 1
6565
fi
66+
67+
# Prohibit long lines in php files.
68+
long_lines=$(find . -type "f" -iname "*.php" -exec awk '{print FILENAME":"NR" "length}' {} \; | awk '$2 > 120')
69+
if [[ ! -z "${long_lines}" ]]; then
70+
echo -e "${long_lines}" | perl -pe 's/^(.*)$/Long lines found in \1/'
71+
exit 1
72+
fi

0 commit comments

Comments
 (0)