Change in vdsm[master]: Makefile: optionally disable PEP8 and Pyflakes

phoracek at redhat.com phoracek at redhat.com
Thu Sep 10 22:34:55 UTC 2015


Petr Horáček has uploaded a new change for review.

Change subject: Makefile: optionally disable PEP8 and Pyflakes
......................................................................

Makefile: optionally disable PEP8 and Pyflakes

Now it is possible to run `make rpm` without PEP8 checking only with
hacky PEP8=true. Pyflakes can not be disabled at all.

With this patch, PEP8 and Pyflakes will not be tested when
PYFLAKES=false / PEP8=false.

We need this for proper implementation of automation/build-artifacts.sh

Change-Id: Ie0ecd61dc0a1b064e980c631c41b3dbfbc6e6fdc
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M Makefile.am
1 file changed, 20 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/46044/1

diff --git a/Makefile.am b/Makefile.am
index 5508094..b52270b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -115,21 +115,29 @@
 
 .PHONY: pyflakes
 pyflakes:
-	python -c 'import pyflakes; print("pyflakes-%s" % pyflakes.__version__)'
-	( find . -path './.git' -prune -type f -o \
-		-name '*.py' -o -name '*.py.in' && \
-		echo $(WHITELIST) ) | xargs $(PYFLAKES) | \
-		grep -w -v $(SKIP_PYFLAKES_ERR) | \
-		while read LINE; do echo "$$LINE"; false; done
+	if [ "$(PYFLAKES)" != false ]; then \
+	    python -c 'import pyflakes; print("pyflakes-%s" % pyflakes.__version__)'; \
+	    ( find . -path './.git' -prune -type f -o \
+		    -name '*.py' -o -name '*.py.in' && \
+		    echo $(WHITELIST) ) | xargs $(PYFLAKES) | \
+		    grep -w -v $(SKIP_PYFLAKES_ERR) | \
+		    while read LINE; do echo "$$LINE"; false; done; \
+	else \
+	    echo "Warning: skip Pyflakes"; \
+	fi
 
 .PHONY: pep8
 pep8:
-	$(PEP8) --version
-	for x in $(PEP8_BLACKLIST); do \
-	    exclude="$${exclude},$${x}" ; \
-	done ; \
-	$(PEP8) --exclude="$${exclude}" --filename '*.py,*.py.in' . \
-	$(WHITELIST)
+	if [ "$(PEP8)" != false ]; then \
+	    $(PEP8) --version; \
+	    for x in $(PEP8_BLACKLIST); do \
+	        exclude="$${exclude},$${x}" ; \
+	    done ; \
+	    $(PEP8) --exclude="$${exclude}" --filename '*.py,*.py.in' . \
+	    $(WHITELIST); \
+	else \
+	    echo "Warning: skip PEP8"; \
+	fi
 
 .PHONY: python3
 python3:


-- 
To view, visit https://gerrit.ovirt.org/46044
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0ecd61dc0a1b064e980c631c41b3dbfbc6e6fdc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>


More information about the vdsm-patches mailing list