-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMakefile
54 lines (36 loc) · 954 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
PROJECT := jsoncomparison
VENV := .venv
REPORTS := .reports
TESTS := tests
PY_FILES := $(shell find $(PROJECT) $(TESTS) -name "*.py")
clean:
@rm -rf .mypy_cache
@rm -rf .pytest_cache
@rm -rf .coverage
@rm -rf $(REPORTS)
@rm -rf $(VENV)
$(VENV):
poetry install --no-root
$(REPORTS):
mkdir $(REPORTS)
setup: $(VENV) $(REPORTS)
flake: setup
poetry run flake8 --max-complexity=10 $(PROJECT) $(TESTS)
mypy: setup
poetry run mypy $(PROJECT) $(TESTS)
bandit: setup
poetry run bandit -rq $(PROJECT) $(TESTS)
isort: setup
poetry run isort $(PROJECT) $(TESTS)
isort-lint: setup
poetry run isort -c $(PROJECT) $(TESTS)
trailing: setup
@poetry run add-trailing-comma $(PY_FILES) --exit-zero-even-if-changed
trailing-lint: setup
@poetry run add-trailing-comma $(PY_FILES)
test: setup
poetry run pytest --cov=$(PROJECT)
format: isort trailing
lint: flake mypy bandit isort-lint trailing-lint
all: format lint test
.DEFAULT_GOAL := all