-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (41 loc) · 1.13 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
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.ONESHELL:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
# region: environment
bootstrap: install install-precommit
.PHONY: bootstrap
install:
poetry install
.PHONY: install
install-precommit:
poetry run pre-commit install && poetry run pre-commit install-hooks
.PHONY: install-precommit
# endregion
# region: dev
format:
poetry run black $(target) --config=pyproject.toml
poetry run isort $(target) --profile=black
.PHONY: format
# endregion
# region: ci
lint:
poetry run black $(target) --check --config=pyproject.toml
poetry run isort $(target) --check
poetry run flake8 $(target) --config=.flake8
poetry run mypy $(target) --config-file=pyproject.toml
.PHONY: lint
test:
poetry run coverage run $(COV_ARGS) -m pytest $(target) $(TEST_ARGS)
poetry run coverage report $(COV_ARGS)
poetry run coverage xml $(COV_ARGS)
.PHONY: test
COV_ARGS ?= --rcfile=.coveragerc
TEST_ARGS ?= --junit-xml=junit.xml
coverage-report:
poetry run coverage xml --rcfile=.coveragerc
poetry run coverage html --rcfile=.coveragerc
.PHONY: coverage-report
target ?= .
# endregion