diff options
Diffstat (limited to 'test/check-trailing-whitespace.sh')
-rwxr-xr-x | test/check-trailing-whitespace.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/check-trailing-whitespace.sh b/test/check-trailing-whitespace.sh new file mode 100755 index 00000000..4aa4af9a --- /dev/null +++ b/test/check-trailing-whitespace.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +top_srcdir=${SOURCE_ROOT:-..} +. ${top_srcdir}/test/setup_env.sh + +ebegin "Checking trailing whitespace in code" +# XXX: Should we check man pages too ? +out=$(cd ${top_srcdir}; find */ \ + '(' -name '*.[ch]' -o -name '*.in' -o -name '*.sh' ')' \ + -exec grep -n -E '[[:space:]]+$' {} +) +[ -z "${out}" ] +eend $? "Trailing whitespace needs to be deleted:"$'\n'"${out}" |