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
This commit is contained in:
Jon Schlueter 2015-05-06 08:50:27 -04:00 committed by Jon Schlueter
commit ae8554bb4c

View file

@ -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
# -----------------------------------------------------------------