Browse code

CI: move whitespace check to external script

Without this measure, a failed check is no longer detected. This seems
to be a bug in gitlab CI.

Christoph Groth authored on 04/01/2017 14:45:01
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,8 @@
1
+#!/bin/sh
2
+
3
+! for f in $(git ls-files | grep -v \\.diff$); do
4
+    file $f | grep -q ' text' || continue
5
+    grep -q '[[:blank:]]$' $f && echo $f: trailing whitespace
6
+    tail -n1 $f | read -r _ || echo $f: no newline at end of file
7
+    tail -n1 $f | grep -q '^$' && echo $f: empty line at end of file
8
+done | grep . >&2