usr_sbin/grml-chroot: Fix a couple of shellcheck warnings
[grml-scripts.git] / Makefile
1 .DEFAULT_GOAL:=help
2
3 help:  ## Display this help
4         @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)
5
6 all: codecheck spellcheck ## Run codecheck and spellcheck
7
8 codecheck: shellcheck pythoncheck ## Run shellcheck and pythoncheck
9
10 shellcheck: ## Run shellcheck
11         for shellfile in $$(ls usr_bin/* usr_sbin/* usr_share/* | grep -v "iimage"); do head -1 "$${shellfile}" | grep -q "/bin/bash\|/bin/sh" && shellcheck -e SC1117 -x "$${shellfile}"; done
12
13 .ONESHELL:
14 pythoncheck: ## Run shellcheck
15         for pythonfile in usr_bin/* usr_sbin/* usr_share/*; do
16                 if head -1 "$${pythonfile}" | grep -q "python"; then
17                         flake8 "$${pythonfile}"
18                         isort --check "$${pythonfile}"
19                         black --check "$${pythonfile}"
20                 fi
21         done
22
23 spellcheck: ## Run spellcheck
24         spellintian manpages/*