Added make check support which checks syntax of uncommited .pp files.
This commit is contained in:
parent
19b06696e7
commit
e35dcb9de9
1 changed files with 12 additions and 0 deletions
12
Makefile
12
Makefile
|
@ -6,3 +6,15 @@ all: puppet-modules.tar.gz
|
|||
puppet-modules.tar.gz: $(MODULES)
|
||||
umask 022 ; tar zcvf $@ --owner=root --group=root \
|
||||
--mode g-w,o=g --exclude=.git $^
|
||||
|
||||
check:
|
||||
@which puppet > /dev/null 2>&1 || ( \
|
||||
echo "puppet not installed, cannot perform syntax checking" \
|
||||
1>&2 ; exit 1 )
|
||||
@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 ; \
|
||||
done
|
Loading…
Add table
Reference in a new issue