From d55a74c4187837347f8edbdd034e28cfee1e9a15 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sat, 13 Feb 2021 16:23:00 +1000 Subject: feat(CI): check for trailing whitespace Run on pull request only. Use a shell script to check for trailing whitespace in all files. Fail if trailing whitespace is found. --- test/check-for-trailing-whitespace.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 test/check-for-trailing-whitespace.sh (limited to 'test') 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 -- cgit v1.2.3