X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=Makefile;fp=Makefile;h=6e0dc8dc3fb47825c0e229ca23adc7ad439b209b;hb=cb8ed979c962c8f81b6ffe4334ae792aad256423;hp=0000000000000000000000000000000000000000;hpb=29bfc533ade39978f73afaecf01062151e43e267;p=grml-scripts.git diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6e0dc8d --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +.DEFAULT_GOAL:=help + +help: ## Display this help + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST) + +all: codecheck spellcheck ## Run codecheck and spellcheck + +codecheck: shellcheck pythoncheck ## Run shellcheck and pythoncheck + +shellcheck: ## Run shellcheck + for shellfile in usr_bin/* usr_sbin/* usr_share/*; do head -1 "$${shellfile}" | grep -q "/bin/bash\|/bin/sh" && shellcheck "$${shellfile}"; done + +.ONESHELL: +pythoncheck: ## Run shellcheck + for pythonfile in usr_bin/* usr_sbin/* usr_share/*; do + if head -1 "$${pythonfile}" | grep -q "python"; then + flake8 "$${pythonfile}" + isort --check "$${pythonfile}" + black --check "$${pythonfile}" + fi + done + +spellcheck: ## Run spellcheck + spellintian manpages/*