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.
This commit is contained in:
John Bampton
2021-02-13 16:23:00 +10:00
parent 8e01fc8933
commit d55a74c418
3 changed files with 23 additions and 1 deletions
+13
View File
@@ -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