-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (63 loc) · 1.37 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.DEFAULT_GOAL := help
help:
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \
sort | \
awk -F ':.*?## ' 'NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'
### Format (Check only) ###
fmt-chk-black:
@echo "## black (check) ##"
@-black . --check
@echo
fmt-chk-autoflake:
@echo "## autoflake (check) ##"
@-autoflake -r . --exclude venv --expand-star-imports --remove-unused-variables --remove-all-unused-imports
@echo
fmt-chk-isort:
@echo "## isort (check) ##"
@-isort . -c
@echo
fmt-chk: ## Format (check)
fmt-chk: fmt-chk-black fmt-chk-isort fmt-chk-autoflake
### Format ###
fmt-black:
@echo "## black ##"
@-black .
@echo
fmt-autoflake:
@echo "## autoflake ##"
@-autoflake -vri . --exclude venv --expand-star-imports --remove-unused-variables --remove-all-unused-imports
@echo
fmt-isort:
@echo "## isort ##"
@-isort .
@echo
fmt: ## Format
fmt: fmt-black fmt-isort fmt-autoflake
### Linting ###
lint-bandit:
@echo "## bandit ##"
@-bandit -r . -c "pyproject.toml"
@echo
lint-flake8:
@echo "## flake8 ##"
@-flake8 .
@echo
lint-pydoc:
@echo "## pydocstyle ##"
@-pydocstyle .
@echo
lint-yaml:
@echo "## yamllint ##"
@-yamllint .
@echo ""
lint-mypy:
@echo "## mypy ##"
@-mypy .
@echo ""
lint: ## Lint
lint: lint-bandit lint-flake8 lint-pydoc lint-yaml lint-mypy
test: ## Test
test:
pytest -vv tests
all: ## Format, lint and test
all: fmt lint test