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