-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
36 lines (28 loc) · 1.07 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
name = htp_md
tag = ${name}
build_tag= ${name}-build
container = ${build_tag}
workspace = $(shell pwd)
env = local
clean:
rm -rf .coverage coverage_reports
lint:
pycodestyle htpmd
flake8 --count --show-source --statistics htpmd
flake8 --count --exit-zero --max-complexity=20 --statistics htpmd
test:
pytest htpmd --color=yes --cov=htpmd --cov-config=.coveragerc --cov-report html:coverage_reports
clean-docker: clean
docker rm -f ${name} || true
docker rm -f ${build_tag} || true
build-docker: clean-docker
docker build -t ${build_tag} .
test-docker: build-docker
docker run -d --name ${container} ${build_tag}
docker exec ${container} bash -c 'pycodestyle htpmd'
docker exec ${container} bash -c 'flake8 --count --show-source --statistics htpmd'
# exit-zero treats all errors as warnings.
docker exec ${container} bash -c 'flake8 --count --exit-zero --max-complexity=20 --statistics htpmd'
docker exec ${container} bash -c 'pytest htpmd --color=yes --cov=htpmd --cov-config=.coveragerc --cov-report html:coverage_reports'
view-coverage:
open ./coverage_reports/index.html