mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Framework: slightly adapt style checks
This commit is contained in:
+13
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user