From ae8554bb4c63c6c62ec4e58ebbf9aa75c7c3525a Mon Sep 17 00:00:00 2001 From: Jon Schlueter Date: Wed, 6 May 2015 08:50:27 -0400 Subject: [PATCH] Add pep8 check for Examples/python build step as part of build process for make check-python-examples warnings from pep8 are not treated as failures. using same initial ignore list as used for test-suite pep8 --- Examples/Makefile.in | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 834accdfa..36f68f2e1 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -66,6 +66,9 @@ LIBCRYPT = @LIBCRYPT@ SYSLIBS = $(LIBM) $(LIBC) $(LIBCRYPT) LIBPREFIX = +PEP8 = @PEP8@ +PEP8_FLAGS = --ignore=E402,E501,E30,W291,W391 + # RUNTOOL is for use with runtime tools, eg set it to valgrind RUNTOOL = # COMPILETOOL is a way to run the compiler under another tool, or more commonly just to stop the compiler executing @@ -372,7 +375,7 @@ endif PY2TO3 = 2to3 `2to3 -l | grep -v -E "Available|import$$" | awk '{print "-f "$$0}'` -python_run: $(PYSCRIPT) +python_run: $(PYSCRIPT) python_check export PYTHONPATH=".:$$PYTHONPATH"; \ $(RUNTOOL) $(PYTHON) $(PYSCRIPT) $(RUNPIPE) @@ -385,6 +388,16 @@ $(RUNME)3.py: $(SRCDIR)$(RUNME).py cp $< $@ $(PY2TO3) -w $@ >/dev/null 2>&1 +# ----------------------------------------------------------------- +# Run Python pep8 if it exists +# ----------------------------------------------------------------- + +python_check: $(PYSCRIPT) + +if [ -n "$(PEP8)" ]; then \ + $(PEP8) $(PEP8_FLAGS) $(PYSCRIPT) || true;\ + fi + + # ----------------------------------------------------------------- # Version display # -----------------------------------------------------------------