-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
75 lines (57 loc) · 1.42 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
# Common variables
PYTHON=python
PACKAGE_DIR = django_declarative_apis
TEST_DIR = tests
EXAMPLE_DIR = example
TEST_CMD = ${PYTHON} manage.py test --parallel
TEST_WARNINGS_CMD = ${PYTHON} -Wa manage.py test
# see .coveragerc for settings
COVERAGE_CMD = coverage run manage.py test --noinput && coverage xml && coverage report
STATIC_CMD = ruff check .
VULN_STATIC_CMD = bandit -r -ii -ll -x ${PACKAGE_DIR}/migrations ${PACKAGE_DIR}
FORMAT_CMD = ruff format .
FORMATCHECK_CMD = ${FORMAT_CMD} --check
install:
pip install --upgrade pip .[dev]
.PHONY: install
format:
${FORMAT_CMD}
.PHONY: format
static-fix:
${STATIC_CMD} --fix
.PHONY: static-fix
docs:
DJANGO_SETTINGS_MODULE=tests.settings $(MAKE) -C docs html SPHINXOPTS="-W"
.PHONY: docs
readme:
@pandoc -f rst -t markdown_github docs/source/overview.rst > README.md
@echo "\n\n" >> README.md
@pandoc -f rst -t markdown_github docs/source/quickstart.rst >> README.md
.PHONY: readme
# Test targets
test-all: coverage static vuln-static formatcheck docs
.PHONY: test-all
test:
${TEST_CMD}
.PHONY: test
test-warnings:
${TEST_WARNINGS_CMD}
.PHONY: test-warnings
coverage:
${COVERAGE_CMD}
.PHONY: coverage
static:
${STATIC_CMD}
.PHONY: static
vuln-static:
${VULN_STATIC_CMD}
.PHONY: vuln-static
formatcheck:
${FORMATCHECK_CMD}
.PHONY: formatcheck
example-install:
$(MAKE) -C example install
example-test:
$(MAKE) -C example test
example-coverage:
$(MAKE) -C example coverage