[master 1/1] Add PEP8 compliance checking to 'check' target.

dwlehman installerbot-noreply at redhat.com
Fri Nov 6 18:12:14 UTC 2015


From: David Lehman <dlehman at 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


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/56ae29e89b9aad6c61961d49eb01c01521f2116b


More information about the anaconda-patches mailing list