Framework: slightly adapt style checks

This commit is contained in:
Franco Fichtner 2018-01-03 06:16:39 +00:00
parent 2ce83c473c
commit afcdb85f44

View file

@ -270,12 +270,17 @@ sweep: check
find ${.CURDIR} -type f -depth 1 -print0 | \
xargs -0 -n1 ${.CURDIR}/../../Scripts/cleanfile
STYLEDIRS?= src/etc/inc/plugins.inc.d src/opnsense
style: check
@: > ${.CURDIR}/.style.out
@if [ -d ${.CURDIR}/src ]; then \
(phpcs --standard=${.CURDIR}/../../ruleset.xml \
${.CURDIR}/src || true) > ${.CURDIR}/.style.out; \
.for STYLEDIR in ${STYLEDIRS}
@if [ -d ${.CURDIR}/${STYLEDIR} ]; then \
(phpcs --standard=${.CURDIR}/../../ruleset.xml \
${.CURDIR}/${STYLEDIR} || true) > \
${.CURDIR}/.style.out; \
fi
.endfor
@echo -n "Total number of style warnings: "
@grep '| WARNING' ${.CURDIR}/.style.out | wc -l
@echo -n "Total number of style errors: "
@ -284,9 +289,11 @@ style: check
@rm ${.CURDIR}/.style.out
style-fix: check
@if [ -d ${.CURDIR}/src ]; then \
phpcbf --standard=${.CURDIR}/../../ruleset.xml \
${.CURDIR}/src || true; \
.for STYLEDIR in ${STYLEDIRS}
@if [ -d ${.CURDIR}/${STYLEDIR} ]; then \
phpcbf --standard=${.CURDIR}/../../ruleset.xml \
${.CURDIR}/${STYLEDIR} || true; \
fi
.endfor
.PHONY: check