make: add a code style checker for PSR1/PSR2

This commit is contained in:
Franco Fichtner 2014-12-28 10:22:40 +01:00
parent f03a3a1ef9
commit edecc7bcd4

View File

@ -22,10 +22,20 @@ sweep:
! -name "*.map" -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
style:
@(phpcs --tab-width=4 --standard=PSR2 ${.CURDIR}/src/opnsense \
|| true) > ${.CURDIR}/.style.out
@echo -n "Total number of style warnings: "
@grep '| WARNING' ${.CURDIR}/.style.out | wc -l
@echo -n "Total number of style errors: "
@grep '| ERROR' ${.CURDIR}/.style.out | wc -l
@cat ${.CURDIR}/.style.out
@rm ${.CURDIR}/.style.out
setup:
${.CURDIR}/src/etc/rc.php_ini_setup
clean:
git reset --hard HEAD && git clean -xdqf .
.PHONY: mount umount install lint sweep setup clean
.PHONY: mount umount install lint sweep style setup clean