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

dwlehman installerbot-noreply at redhat.com
Fri Nov 6 17:10:29 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 | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 047a2dd..0a129eb 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
@@ -66,8 +67,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 +184,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/4f8d7d60ad4cb7e430910518c5751ef75f04c549


More information about the anaconda-patches mailing list