-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
63 lines (53 loc) · 1.31 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
# Convenience makefile to build the dev env and run common commands
# Based on https://github.com/teamniteo/Makefile
.PHONY: all
all: tests
# Testing and linting targets
all = false
.PHONY: lint
lint:
@black --diff .
@isort --diff --check-only -rc .
.PHONY: types
types:
@mypy pyramid_cloudflare_access
@cat ./typecov/linecount.txt
@command typecov 90 ./typecov/linecount.txt
# anything, in regex-speak
filter = "."
# additional arguments for pytest
full_suite = "false"
ifeq ($(filter),".")
full_suite = "true"
endif
ifdef path
full_suite = "false"
endif
args = ""
pytest_args = -k $(filter) $(args)
ifeq ($(args),"")
pytest_args = -k $(filter)
endif
verbosity = ""
ifeq ($(full_suite),"false")
verbosity = -vv
endif
full_suite_args = ""
ifeq ($(full_suite),"true")
full_suite_args = --cov=pyramid_cloudflare_access --cov-branch --cov-report html --cov-report xml:cov.xml --cov-report term-missing --cov-fail-under=100
endif
.PHONY: unit
unit:
ifndef path
@pytest pyramid_cloudflare_access $(verbosity) $(full_suite_args) $(pytest_args)
else
@pytest $(path)
endif
.PHONY: tests
tests: lint unit
fmt: format
black: format
format:
@poetry run isort -rc --atomic pyramid_cloudflare_access
@poetry run autoflake --remove-all-unused-imports -i -r pyramid_cloudflare_access
@poetry run black pyramid_cloudflare_access