Commit b757f830 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

check-python-code: Report EOL whitespace


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarLuca Bigliardi <shammash@google.com>
parent eed5c5df
...@@ -25,6 +25,12 @@ for script; do ...@@ -25,6 +25,12 @@ for script; do
let ++problems let ++problems
echo "Found tabs in $script" >&2 echo "Found tabs in $script" >&2
fi fi
if grep -H -E '[[:space:]]$' "$script"; then
let ++problems
echo "Found end-of-line-whitespace in $script" >&2
fi
if [[ "$(wc --max-line-length < "$script")" -gt 80 ]]; then if [[ "$(wc --max-line-length < "$script")" -gt 80 ]]; then
let ++problems let ++problems
echo "Longest line in $script is longer than 80 characters" >&2 echo "Longest line in $script is longer than 80 characters" >&2
...@@ -32,6 +38,6 @@ for script; do ...@@ -32,6 +38,6 @@ for script; do
done done
if [[ "$problems" -gt 0 ]]; then if [[ "$problems" -gt 0 ]]; then
echo "Found $problems problems while checking code." >&2 echo "Found $problems problem(s) while checking code." >&2
exit 1 exit 1
fi fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment