ci: reject trailing whitespace

This commit is contained in:
Fang 2020-01-03 12:45:36 +01:00
parent f4ed556717
commit 16ae3b7298
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 15 additions and 0 deletions

View File

@ -5,6 +5,7 @@ install:
- nix-env -iA cachix -f https://cachix.org/api/v1/install
before_install:
- ./sh/test-whitespace
- git lfs pull
script:

14
sh/test-whitespace Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
whitespace=$(find . \
\( -path ./.git -o \
-path ./nix -o \
-path ./bin \) -prune \
-o -type f -exec egrep -lI " +$" {} \;);
if [ ! -z "$whitespace" ]
then
echo "found trailing whitespace in:";
echo "$whitespace";
exit 1;
fi