Moves 'pylint' to its own target, adds a 'pep8' target, and makes the 'check' target empty with 'check' and 'pep8' as prerequisites. This allows the user to run either pylint or pep8 separately or together.
It also makes it possible to plumb a user-specified PYTHONPATH into the 'pylint' target.
From: David Lehman dlehman@redhat.com
Moves 'pylint' to its own target, adds a 'pep8' target, and makes the 'check' target empty with 'check' and 'pep8' as prerequisites. This allows the user to run either pylint or pep8 separately or together.
It also makes it possible to plumb a user-specified PYTHONPATH into the 'pylint' target. --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile index 047a2dd..1ca2d3d 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ VERSION_TAG=$(PKGNAME)-$(VERSION)
PYTHON=python3 COVERAGE=coverage +PEP8=$(PYTHON)-pep8 ifeq ($(PYTHON),python3) COVERAGE=coverage3 endif @@ -24,6 +25,7 @@ TEST_DEPENDENCIES += python3-gobject TEST_DEPENDENCIES += python-coverage python3-coverage TEST_DEPENDENCIES += xfsprogs hfsplus-tools TEST_DEPENDENCIES += python3-pocketlint +TEST_DEPENDENCIES += python3-pep8 TEST_DEPENDENCIES := $(shell echo $(sort $(TEST_DEPENDENCIES)) | uniq)
all: @@ -66,8 +68,15 @@ coverage: check-requires $(COVERAGE) report --include="blivet/*" --show-missing $(COVERAGE) report --include="blivet/*" > coverage-report.log
-check: check-requires - PYTHONPATH=. tests/pylint/runpylint.py +pylint: check-requires + @echo "*** Running pylint ***" + PYTHONPATH=.:$(PYTHONPATH) tests/pylint/runpylint.py + +pep8: check-requires + @echo "*** Running pep8 compliance check ***" + $(PEP8) --ignore=E501 blivet/ tests/ examples/ + +check: pylint pep8
clean: -rm *.tar.gz blivet/*.pyc blivet/*/*.pyc ChangeLog @@ -176,4 +185,4 @@ ci: check coverage rc-release @mkdir -p repo @mv *rpm repo
-.PHONY: check clean install tag archive local +.PHONY: check clean pylint pep8 install tag archive local
From: David Lehman dlehman@redhat.com
--- tests/devicelibs_test/edd_test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/devicelibs_test/edd_test.py b/tests/devicelibs_test/edd_test.py index da6c424..2dab709 100644 --- a/tests/devicelibs_test/edd_test.py +++ b/tests/devicelibs_test/edd_test.py @@ -54,8 +54,7 @@ def setUp(self): self.log_handler.setFormatter(formatter) edd.log.addHandler(self.log_handler)
- self.td_log_handler = logging.FileHandler("%s/%s" % - (ws, "blivet-edd-testdata.log")) + self.td_log_handler = logging.FileHandler("%s/%s" % (ws, "blivet-edd-testdata.log")) self.td_log_handler.setLevel(logging.DEBUG) formatter = logging.Formatter("%(asctime)s %(levelname)s %(name)s: %(message)s") self.td_log_handler.setFormatter(formatter)
anaconda-patches@lists.fedorahosted.org