From 999b0899a13d38ec5f6477e2867bb1d4ac1ff5a1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 3 Jan 2018 06:34:08 +0000 Subject: [PATCH] make: rework style passes --- Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 0deea4908..633202c48 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2017 Franco Fichtner +# Copyright (c) 2014-2018 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -300,11 +300,14 @@ sweep: force find ${.CURDIR} -type f -depth 1 -print0 | \ xargs -0 -n1 ${.CURDIR}/Scripts/cleanfile +STYLEDIRS?= src/etc/inc/plugins.inc.d src/opnsense + style: want-pear-PHP_CodeSniffer - @(phpcs --standard=ruleset.xml ${.CURDIR}/src/etc/inc/plugins.inc.d \ - || true) > ${.CURDIR}/.style.out - @(phpcs --standard=ruleset.xml ${.CURDIR}/src/opnsense \ + @: > ${.CURDIR}/.style.out +.for STYLEDIR in ${STYLEDIRS} + @(phpcs --standard=ruleset.xml ${.CURDIR}/${STYLEDIR} \ || true) >> ${.CURDIR}/.style.out +.endfor @echo -n "Total number of style warnings: " @grep '| WARNING' ${.CURDIR}/.style.out | wc -l @echo -n "Total number of style errors: " @@ -313,8 +316,9 @@ style: want-pear-PHP_CodeSniffer @rm ${.CURDIR}/.style.out style-fix: want-pear-PHP_CodeSniffer - phpcbf --standard=ruleset.xml ${.CURDIR}/src/etc/inc/plugins.inc.d || true - phpcbf --standard=ruleset.xml ${.CURDIR}/src/opnsense || true +.for STYLEDIR in ${STYLEDIRS} + phpcbf --standard=ruleset.xml ${.CURDIR}/${STYLEDIR} || true +.endfor license: @${.CURDIR}/Scripts/license > ${.CURDIR}/LICENSE