-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (41 loc) · 795 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
SRC_DIR := src
TEST_DIR := tests
DATE := $(shell date +%s000)
all: static test
.PHONY: init
init:
pre-commit install
.PHONY: pre_commit
pre_commit:
pre-commit run --all-files
.PHONY: fmt
fmt:
black $(SRC_DIR) $(TEST_DIR)
isort $(SRC_DIR) $(TEST_DIR)
.PHONY: fmt_check
fmt_check:
black --check $(SRC_DIR) $(TEST_DIR)
isort --check $(SRC_DIR) $(TEST_DIR)
.PHONY: lint
lint:
flake8 $(SRC_DIR) $(TEST_DIR)
.PHONY: security
security:
bandit -r $(SRC_DIR)
safety scan
.PHONY: type
type:
mypy src
.PHONY: static
static: fmt_check lint security type
.PHONY: test
test:
pytest \
--cov=$(SRC_DIR) $(TEST_DIR)
.PHONY: test_report
test_report:
pytest \
--junitxml=reports/pytest.xml \
--cov-report term \
--cov-report xml:reports/coverage.xml \
--cov=$(SRC_DIR) $(TEST_DIR)