forked from hhatto/autopep8
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
67 lines (56 loc) · 1.76 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
all:
@echo "make test(test_basic, test_diff, test_unit)"
@echo "make pypireg"
@echo "make coverage"
@echo "make check"
@echo "make clean"
PYTHON?=python
COVERAGE?=coverage
TEST_DIR=test
.PHONY: test
test: test_basic test_diff test_unit
test_basic:
@echo '---> Running basic test'
${PYTHON} autopep8.py test/example.py > .tmp.test.py
pep8 --repeat .tmp.test.py
@rm .tmp.test.py
test_diff:
@echo '---> Running --diff test'
@cp test/example.py .tmp.example.py
${PYTHON} autopep8.py --diff .tmp.example.py > .tmp.example.py.patch
patch < .tmp.example.py.patch
@rm .tmp.example.py.patch
pep8 --repeat .tmp.example.py && ${PYTHON} -m py_compile .tmp.example.py
@rm .tmp.example.py
test_unit:
@echo '---> Running unit tests'
${PYTHON} test/test_autopep8.py
coverage:
@rm -rf htmlcov
@AUTOPEP8_COVERAGE=1 ${COVERAGE} run --branch --parallel test/test_autopep8.py
@${COVERAGE} combine
@${COVERAGE} report
@${COVERAGE} html
@${COVERAGE} xml --include=autopep8.py
@echo 'Coverage report: htmlcov/index.html'
@rm .coverage
open_coverage: coverage
@python -m webbrowser -n "file://${PWD}/htmlcov/index.html"
readme:
${PYTHON} update_readme.py
@python setup.py --long-description | rst2html --strict > README.html
@python -m webbrowser -n "file://${PWD}/README.html"
check:
pep8 autopep8.py
pylint --reports=no --include-ids=yes --max-module-lines=2500 \
--disable=C0111,C0103,F0401,R0902,R0903,W0404,R0914,R0912,R0915,R0904,R0911,R0913,W0142,E1101,E0702 \
--rcfile=/dev/null autopep8.py
./autopep8.py --diff test/test_autopep8.py
./autopep8.py --diff autopep8.py
pypireg:
${PYTHON} setup.py register
${PYTHON} setup.py sdist upload
clean:
rm -rf .tmp.test.py temp *.pyc *egg-info dist build \
__pycache__ */__pycache__ */*/__pycache__ \
htmlcov coverage.xml