summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/check-for-trailing-whitespace.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/check-for-trailing-whitespace.sh b/test/check-for-trailing-whitespace.sh
new file mode 100755
index 000000000..00be038f3
--- /dev/null
+++ b/test/check-for-trailing-whitespace.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+cd .. || exit
+# print first
+grep -EHInr '( +)$' ./*
+
+var=$(grep -EHInr '( +)$' ./*)
+# then exit with fail if found
+if test -z "$var"; then
+ exit 0
+else
+ exit 1
+fi