From f39ff91fc2c6172d878f1c444c96ea0ddec85d2c Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 2 Jan 2019 11:24:40 +0100 Subject: [PATCH] Framework: break out lint steps, new lint-exec This is to catch the PRs submitted via GitHub that cannot change file permissions. CC: @mimugmail --- Mk/plugins.mk | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 268197fc1..18d34e71f 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2018 Franco Fichtner +# Copyright (c) 2015-2019 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -265,12 +265,21 @@ lint-desc: check echo ">>> Missing ${PLUGIN_DESC}"; exit 1; \ fi -lint: lint-desc - find ${.CURDIR}/src \ +lint-shell: + @find ${.CURDIR}/src \ -name "*.sh" -type f -print0 | xargs -0 -n1 sh -n - find ${.CURDIR}/src \ + +lint-xml: + @find ${.CURDIR}/src \ -name "*.xml" -type f -print0 | xargs -0 -n1 xmllint --noout - find ${.CURDIR}/src \ + +lint-exec: check + @find ${.CURDIR}/src/opnsense/scripts -type f ! -name "*.xml" \ + -print0 | xargs -0 -t -n1 test -x || \ + (echo "Missing executable permission"; exit 1) + +lint-php: check + @find ${.CURDIR}/src \ ! -name "*.xml" ! -name "*.xml.sample" ! -name "*.eot" \ ! -name "*.svg" ! -name "*.woff" ! -name "*.woff2" \ ! -name "*.otf" ! -name "*.png" ! -name "*.js" \ @@ -278,6 +287,8 @@ lint: lint-desc ! -name "*.tgz" ! -name "*.xml.dist" ! -name "*.sh" \ -type f -print0 | xargs -0 -n1 php -l +lint: lint-desc lint-shell lint-xml lint-exec lint-php + sweep: check find ${.CURDIR}/src -type f -name "*.map" -print0 | \ xargs -0 -n1 rm