-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
41 lines (30 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# Makefile
#
BASH_SRCS := $(shell find ./ -name '*.sh')
PY_SRCS := $(shell find ./ -name '*.py')
ALL_SCRIPT_SRCS := $(BASH_SRCS) $(PY_SRCS)
all:
@echo "Makefile needs your attention"
codecheck-scripts: $(ALL_SCRIPT_SRCS)
@echo "* Run flake8 for Python sources..."
flake8 --ignore=E501,E266,E203,E231,W503,F401,F841 $(PY_SRCS)
@echo "* Run shellcheck for BASH sources..."
shellcheck $(BASH_SRCS)
format-scripts: $(ALL_SCRIPT_SRCS)
@echo "* Format all Python sources with black..."
black $(PY_SRCS)
@echo "* Format all Bash sources with shfmt..."
shfmt -i 4 -w $(BASH_SRCS)
## Cleanup utilities
rm-all-containers:
@echo "Remove all docker containers"
docker container rm $$(docker ps -aq) -f
rm-dangling-images:
@echo "Remove all dangling docker images"
docker rmi $$(docker images -f "dangling=true" -q)
pp-empty-dirs:
@echo "Print empty directories"
@find -maxdepth 3 -type d -empty
# vim:ft=make
#