mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-09 08:56:23 -04:00
Framework: slightly adapt style checks
This commit is contained in:
parent
2ce83c473c
commit
afcdb85f44
1 changed files with 13 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue