Framework: break out lint steps, new lint-exec

This is to catch the PRs submitted via GitHub that cannot change
file permissions.

CC: @mimugmail
This commit is contained in:
Franco Fichtner 2019-01-02 11:24:40 +01:00
parent c0c8cde700
commit f39ff91fc2

View file

@ -1,4 +1,4 @@
# Copyright (c) 2015-2018 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2019 Franco Fichtner <franco@opnsense.org>
#
# 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