-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (50 loc) · 1.79 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
.DEFAULT_GOAL := help
.PHONY: help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Formatters
.PHONY: format-black
format-black: ## run black (code formatter)
@black .
.PHONY: format-isort
format-isort: ## run isort (imports formatter)
@isort .
.PHONY: format
format: format-black format-isort ## run all formatters
##@ Linters
.PHONY: lint-black
lint_black: ## run black in linting mode
@black . --check
.PHONY: lint-isort
lint-isort: ## run isort in linting mode
@isort . --check
.PHONY: lint-flake8
lint-flake8: ## run flake8 (code linter)
@flake8 ./object_detection_task
.PHONY: lint-mypy
lint-mypy: ## run mypy (static-type checker)
@mypy --config-file pyproject.toml ./object_detection_task
.PHONY: lint-mypy-report
lint-mypy-report: ## run mypy & create report
@mypy --config-file pyproject.toml . --html-report ./mypy_html
lint: lint-black lint-isort lint-flake8 lint-mypy
##@ Testing
.PHONY: unit-tests
unit-tests: ## run unit-tests
@pytest
.PHONY: unit-tests-cov
unit-tests-cov: ## run unit-tests with coverage
@pytest --cov=object_detection_task --cov-report term-missing --cov-report=html
.PHONY: unit-tests-cov-fail
unit-tests-cov-fail: ## run unit-tests with coverage and cov-fail level
@pytest --cov=object_detection_task --cov-report term-missing --cov-report=html --cov-fail-under=80 --junitxml=pytest.xml | tee pytest-coverage.txt
##@ Clean-up
clean-cov: ## run cleaning from reports
@rm -rf .coverage
@rm -rf htmlcov
@rm -rf pytest.xml
@rm -rf pytest-coverage.txt
@rm -rf coverage.xml
@rm -rf mypy_html
clean-docs: ## remove output files from mkdocs
@rm -rf site