-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
39 lines (27 loc) · 858 Bytes
/
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
SHELL := /bin/bash
PYTHON ?= python3
SH_SCRIPTS := scripts/*.sh .scripts/*.sh
PY_SCRIPTS := scripts/*.py .scripts/*.py scripts/lint-{logs,recipes}
export PYTHONWARNINGS := default
.PHONY: all test doctest lint lint-recipes lint-scripts lint-logs
.PHONY: check-commandlinetools clean cleanup
all:
test: doctest lint
doctest:
$(PYTHON) -m doctest $(PY_SCRIPTS)
lint: lint-recipes lint-scripts
lint-recipes:
PYTHONWARNINGS= scripts/lint-recipes recipes/*.yml
lint-scripts:
shellcheck $(SH_SCRIPTS)
flake8 $(PY_SCRIPTS)
pylint $(PY_SCRIPTS)
set -e; for script in $(PY_SCRIPTS); do \
mypy --strict --disallow-any-unimported "$$script"; \
done
lint-logs:
PYTHONWARNINGS= scripts/lint-logs index.json logs/*.json
clean: cleanup
cleanup:
find -name '*~' -delete -print
rm -fr scripts/__pycache__/ .scripts/__pycache__/ .mypy_cache/