diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/detect_trailing_whitespace.sh | 17 |
1 files changed, 17 insertions, 0 deletions
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 +) |