diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 6cbc59210..6a9b3fc6e 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -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