From 80c8a0b58ff8c41d0bfa907d2ef11874a2dee4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Thu, 14 Oct 2010 13:32:23 +0300 Subject: [PATCH] Added trailing white space check to "make check". --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 20decae..354a4e8 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,8 @@ check: @for name in `git diff --name-only`; do \ echo $${name} | egrep '\.pp$$' > /dev/null || continue ; \ errors="`puppet --color=false --parseonly --ignoreimport $${name}`" ; \ - [ $$? -eq 0 ] && continue ; \ - echo "syntax check failed on $${name}" 1>&2 ; \ - echo " $${errors}" 1>&2 ; \ + [ $$? -eq 0 ] || echo "$${errors}" 1>&2 ; \ + errors="`egrep --line-number '[[:space:]]$$' $${name}`" ; \ + [ $$? -eq 0 ] && echo "$${name}: trailing white spaces on" \ + "line $${errors}" 1>&2 ; \ done \ No newline at end of file