-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
78 lines (58 loc) · 2 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
SRC_DIR = src/rhsm
STYLETESTS ?=
PYFILES=`find ${SRC_DIR} -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
docs:
python setup.py build_sphinx
check:
python setup.py -q nosetests -c playpen/noserc.dev
coverage: coverage-jenkins
coverage-html: coverage-jenkins
coverage-jenkins:
python setup.py -q nosetests -c playpen/noserc.ci
clean:
rm -f *~ *.bak *.tar.gz
find . -name "*.py[com]" | xargs rm -f
python setup.py clean --all
rm -rf cover/ htmlcov/ docs/sphinx/_build/ build/ dist/
version_check:
# needs https://github.com/alikins/pyqver
-@TMPFILE=`mktemp` || exit 1; \
pyqver2.py -v -m 2.5 $(STYLEFILES) | tee $$TMPFILE; \
! test -s $$TMPFILE
flake8:
@TMPFILE=`mktemp` || exit 1; \
python setup.py -q flake8 -q | 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
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.7 -l $(STYLEFILES) | tee $$TMPFILE; \
! test -s $$TMPFILE
.PHONY: stylish
stylish: flake8 versionlint whitespacelint gettext_lint rpmlint debuglint
jenkins: stylish coverage-jenkins