From 1cd96b2dc482ed484e87de7c26a4af54aca45e1d Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Tue, 4 Sep 2018 17:17:07 +0200 Subject: Trailing whitespace detection script and circleci job. --- scripts/detect_trailing_whitespace.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/detect_trailing_whitespace.sh (limited to 'scripts') diff --git a/scripts/detect_trailing_whitespace.sh b/scripts/detect_trailing_whitespace.sh new file mode 100755 index 00000000..78e69584 --- /dev/null +++ b/scripts/detect_trailing_whitespace.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +REPO_ROOT="$(dirname "$0")"/.. + +( +cd $REPO_ROOT +WHITESPACE=$(git grep -n -I -E "^.*[[:space:]]+$" | grep -v "test/libsolidity/ASTJSON\|test/compilationTests/zeppelin/LICENSE") + +if [[ "$WHITESPACE" != "" ]] +then + echo "Error: Trailing whitespace found:" >&2 + echo "\"$WHITESPACE\"" >&2 + exit 1 +else + exit 0 +fi +) -- cgit From 1ae6ec9038d83a82d5e8b57a8c6138dd4970d422 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Tue, 4 Sep 2018 17:28:52 +0200 Subject: Remove trailing whitespace. --- scripts/detect_trailing_whitespace.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/detect_trailing_whitespace.sh b/scripts/detect_trailing_whitespace.sh index 78e69584..1a136a10 100755 --- a/scripts/detect_trailing_whitespace.sh +++ b/scripts/detect_trailing_whitespace.sh @@ -9,9 +9,7 @@ WHITESPACE=$(git grep -n -I -E "^.*[[:space:]]+$" | grep -v "test/libsolidity/AS if [[ "$WHITESPACE" != "" ]] then echo "Error: Trailing whitespace found:" >&2 - echo "\"$WHITESPACE\"" >&2 + echo "$WHITESPACE" >&2 exit 1 -else - exit 0 fi ) -- cgit