-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (56 loc) · 1.98 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
include Makefile.vars
.PHONY: help
help:
@echo "Available common targets:"
@echo "check --- check everything"
@echo "tests --- run Python unit tests"
@echo "coverage --- run Python unit tests with coverage"
@echo "cs --- run coding standards checks"
@echo "pylint --- run pylint checks only"
@echo "pep8 --- run pep8 checks only"
.PHONY: check
check: cs tests
.PHONY: tests
tests:
@echo Running Python unit tests
$(NOSE) -s $(NOSE_TEST_PATHS)
.PHONY: cs
cs: pep8 pylint
.PHONY: pylint
pylint:
@echo Runing pylint
export PYLINTHOME=$(PYLINT_DIR)
mkdir -p $(PYLINT_DIR)
PYTHONPATH=".:$(PYTHONPATH)" $(PYLINT) --rcfile=.pylintrc $(PACKAGE_NAMES)
.PHONY: codingstandards
codingstandards: pylint-report pep8
.PHONY: pylint-report
pylint-report:
@echo Running pylint with reports
export PYLINTHOME=$(PYLINT_DIR)
mkdir -p $(PYLINT_DIR)
PYTHONPATH=".:$(PYTHONPATH)" $(PYLINT) --report=yes --rcfile=.pylintrc $(PACKAGE_NAMES)
# Ignored errors:
#
# Code Description Reason for ignoring
# ---- ----------- -------------------
# E501 line too long This is checked by pylint
# E126 continuation line over-indented for hanging indent This is not a problem locally, helps readability
# E241 multiple spaces after ',' This is not a problem locally, helps readability
# E121 continuation line indentation is not a multiple of four This is not a problem locally, helps readability
.PHONY: codestyle
codestyle:
@echo "Running pycodestyle (pep8)"
$(PYCODESTYLE) --ignore=E501,E126,E241,E121 --repeat $(PACKAGE_NAMES)
.PHONY: pep8
pep8: codestyle
.PHONY: coverage
coverage: cov cov-html
.PHONY: cov
cov:
$(COVERAGE) run -m nose -s $(NOSE_TEST_PATHS)
.PHONY: cov-html
cov-html:
mkdir -p doc/
$(COVERAGE) html -d doc/coverage
open doc/coverage/index.html || true