-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (32 loc) · 967 Bytes
/
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
define run_on_sources
find sparklogstats tests -name "*.py" -type f | xargs $(1)
endef
help:
@echo ' all: lint, format and coverage'
@echo ' lint: run pylama on *.py files'
@echo ' format: format all *.py files inline using yapf'
@echo ' coverage: run tests and print coverage report'
@echo ' coverage-html: run tests and generate report in coverage_html/index.html'
@echo ' tests: run tests'
@echo ' clean: delete data generated by coverage'
@echo 'clean_worktree: remove all files unknown to git'
all: lint format coverage
lint:
pylama
format:
$(call run_on_sources, yapf -i)
.PHONY: tests
tests:
python3 setup.py test
coverage: .coverage
coverage3 report
.coverage: tests/test_*.py $(RESOURCES)
coverage erase
coverage3 run setup.py test
coverage-html: .coverage
coverage html
@echo 'Output in coverage_html/index.html'
clean:
rm -rf coverage_html .coverage
clean_worktree:
git clean -dxf