aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-09-04 23:17:07 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-09-04 23:36:47 +0800
commit1cd96b2dc482ed484e87de7c26a4af54aca45e1d (patch)
treee9ad333fa078f5208e9041e8fcc6e73b454a9238 /scripts
parentcc7daf7b476f498c4dcde7bdb342974097ffe9bf (diff)
downloaddexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.tar.gz
dexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.tar.zst
dexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.zip
Trailing whitespace detection script and circleci job.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/detect_trailing_whitespace.sh17
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
+)