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:
parent
7770715457
commit
ae8554bb4c
1 changed files with 14 additions and 1 deletions
|
|
@ -66,6 +66,9 @@ LIBCRYPT = @LIBCRYPT@
|
||||||
SYSLIBS = $(LIBM) $(LIBC) $(LIBCRYPT)
|
SYSLIBS = $(LIBM) $(LIBC) $(LIBCRYPT)
|
||||||
LIBPREFIX =
|
LIBPREFIX =
|
||||||
|
|
||||||
|
PEP8 = @PEP8@
|
||||||
|
PEP8_FLAGS = --ignore=E402,E501,E30,W291,W391
|
||||||
|
|
||||||
# RUNTOOL is for use with runtime tools, eg set it to valgrind
|
# RUNTOOL is for use with runtime tools, eg set it to valgrind
|
||||||
RUNTOOL =
|
RUNTOOL =
|
||||||
# COMPILETOOL is a way to run the compiler under another tool, or more commonly just to stop the compiler executing
|
# 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}'`
|
PY2TO3 = 2to3 `2to3 -l | grep -v -E "Available|import$$" | awk '{print "-f "$$0}'`
|
||||||
|
|
||||||
python_run: $(PYSCRIPT)
|
python_run: $(PYSCRIPT) python_check
|
||||||
export PYTHONPATH=".:$$PYTHONPATH"; \
|
export PYTHONPATH=".:$$PYTHONPATH"; \
|
||||||
$(RUNTOOL) $(PYTHON) $(PYSCRIPT) $(RUNPIPE)
|
$(RUNTOOL) $(PYTHON) $(PYSCRIPT) $(RUNPIPE)
|
||||||
|
|
||||||
|
|
@ -385,6 +388,16 @@ $(RUNME)3.py: $(SRCDIR)$(RUNME).py
|
||||||
cp $< $@
|
cp $< $@
|
||||||
$(PY2TO3) -w $@ >/dev/null 2>&1
|
$(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
|
# Version display
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue