forked from candlepin/python-rhsm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (67 loc) · 2.51 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
SRC_DIR = src/rhsm
STYLETESTS ?=
PYFILES=`find src/ -name "*.py"`
TESTFILES=`find test/ -name "*.py"`
STYLEFILES=$(PYFILES)
# note, set STYLETEST to something if you want
# make stylish to check the tests code
# as well
ifdef STYLETESTS
STYLEFILES+=$(TESTFILES)
endif
check:
nosetests
coverage:
nosetests --with-cover --cover-package rhsm --cover-erase
coverage-xunit:
nosetests --with-xunit --with-cover --cover-package rhsm --cover-erase
coverage-html: coverage
coverage html --include "${SRC_DIR}/*"
coverage-html-old:
nosetests --with-cover --cover-package rhsm --cover-html --cover-html-dir test/html --cover-erase
coverage-xml: coverage
coverage xml --include "${SRC_DIR}/*"
coverage-jenkins: coverage-xunit
coverage html --include "${SRC_DIR}/*"
coverage xml --include "${SRC_DIR}/*"
version_check:
# needs https://github.com/alikins/pyqver
-@TMPFILE=`mktemp` || exit 1; \
pyqver2.py -v -m 2.5 $(STYLEFILES) | tee $$TMPFILE; \
! test -s $$TMPFILE
pyflakes:
# pyflakes doesn't have a config file, cli options, or a ignore tag
# and the variants of "redefination" we get now aren't really valid
# and other tools detect the valid cases, so ignore these
#
-@TMPFILE=`mktemp` || exit 1; \
pyflakes $(STYLEFILES) | grep -v "redefinition of unused.*from line.*" | tee $$TMPFILE; \
! test -s $$TMPFILE
pylint:
-@PYTHONPATH="src/:/usr/share/rhn:/usr/share/rhsm" pylint --rcfile=pylintrc $(STYLEFILES)
tablint:
@! GREP_COLOR='7;31' grep --color -nP "^\W*\t" $(STYLEFILES)
trailinglint:
@! GREP_COLOR='7;31' grep --color -nP "[ \t]$$" $(STYLEFILES)
whitespacelint: tablint trailinglint
# look for things that are likely debugging code left in by accident
debuglint:
@! GREP_COLOR='7;31' grep --color -nP "pdb.set_trace|pydevd.settrace|import ipdb|import pdb|import pydevd" $(STYLEFILES)
gettext_lint:
@TMPFILE=`mktemp` || exit 1; \
pcregrep -n --color=auto -M "_\(.*[\'|\"].*[\'|\"]\s*\+\s*[\"|\'].*[\"|\'].*\)" $(STYLEFILES) | tee $$TMPFILE; \
! test -s $$TMPFILE
pep8:
@TMPFILE=`mktemp` || exit 1; \
pep8 --ignore E501 --exclude ".#*" --repeat src $(STYLEFILES) | tee $$TMPFILE; \
! test -s $$TMPFILE
rpmlint:
@TMPFILE=`mktemp` || exit 1; \
rpmlint -f rpmlint.config python-rhsm.spec | grep -v "^.*packages and .* specfiles checked\;" | tee $$TMPFILE; \
! test -s $$TMPFILE
versionlint:
@TMPFILE=`mktemp` || exit 1; \
pyqver2.py -m 2.5 -v $(STYLEFILES) | tee $$TMPFILE; \
! test -s $$TMPFILE
stylish: versionlint pyflakes whitespacelint pep8 gettext_lint rpmlint debuglint
jenkins: stylish coverage-jenkins