From c1096904e74f7e0412f2d0a83390a98c52150cd9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 3 Jun 2016 11:17:02 +0200 Subject: [PATCH] Mk: add lint target and change list print to one-per-line --- Makefile | 9 ++++++++- Mk/plugins.mk | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f2b257bf2..8783b9a6e 100644 --- a/Makefile +++ b/Makefile @@ -11,4 +11,11 @@ PLUGIN_DIRS+= ${_${CATEGORY}} .endfor list: - @echo ${PLUGIN_DIRS} +.for PLUGIN_DIR in ${PLUGIN_DIRS} + @echo ${PLUGIN_DIR} +.endfor + +lint: +.for PLUGIN_DIR in ${PLUGIN_DIRS} + ${MAKE} -C ${PLUGIN_DIR} lint +.endfor diff --git a/Mk/plugins.mk b/Mk/plugins.mk index f31c05319..d115c4618 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -154,4 +154,18 @@ umount: check clean: check @git reset -q . && git checkout -f . && git clean -xdqf . +lint: check + find ${.CURDIR}/src \ + -name "*.sh" -type f -print0 | xargs -0 -n1 sh -n + find ${.CURDIR}/src \ + -name "*.xml" -type f -print0 | xargs -0 -n1 xmllint --noout + find ${.CURDIR}/src \ + ! -name "*.xml" ! -name "*.xml.sample" ! -name "*.eot" \ + ! -name "*.svg" ! -name "*.woff" ! -name "*.woff2" \ + ! -name "*.otf" ! -name "*.png" ! -name "*.js" \ + ! -name "*.scss" ! -name "*.py" ! -name "*.ttf" \ + ! -name "*.tgz" ! -name "*.xml.dist" \ + -type f -print0 | xargs -0 -n1 php -l + + .PHONY: check