Forked from
kwant / kwant
525 commits behind the upstream repository.
-
Christoph Groth authored
Without this measure, a failed check is no longer detected. This seems to be a bug in gitlab CI.
Christoph Groth authoredWithout this measure, a failed check is no longer detected. This seems to be a bug in gitlab CI.
check_whitespace 318 B
#!/bin/sh
! for f in $(git ls-files | grep -v \\.diff$); do
file $f | grep -q ' text' || continue
grep -q '[[:blank:]]$' $f && echo $f: trailing whitespace
tail -n1 $f | read -r _ || echo $f: no newline at end of file
tail -n1 $f | grep -q '^$' && echo $f: empty line at end of file
done | grep . >&2