exit 1; } || :
# In Python files we don't want to end lines with a semicolon like in C
-sc_prohibit_semicolon_at_eol_in_python:
- @prohibit='^[^#].*\;$$' \
- in_vc_files='\.py$$' \
- halt='python does not require to end lines with a semicolon' \
- $(_sc_search_regexp)
+sc_flake8:
+ @if [ -n "$(FLAKE8)" ]; then \
+ $(VC_LIST_EXCEPT) | $(GREP) '\.py$$' | xargs \
+ $(FLAKE8) --select E703 --show-source; \
+ else \
+ echo '$(ME): skipping test $@: flake8 not installed' 1>&2; \
+ fi
# mymain() in test files should use return, not exit, for nicer output
sc_prohibit_exit_in_tests:
echo "*****************************************************" >&2; \
echo "* cppi not installed, some checks have been skipped *" >&2; \
echo "*****************************************************" >&2; \
+ fi; \
+ if [ -z "$(FLAKE8)" ]; then \
+ echo "*****************************************************" >&2; \
+ echo "* flake8 not installed, sc_flake8 has been skipped *" >&2; \
+ echo "*****************************************************" >&2; \
fi
endif
if test -z "$PYTHON"; then
AC_MSG_ERROR(['python3', 'python2' or 'python' binary is required to build libvirt])
fi
+AC_PATH_PROG([FLAKE8], [flake8])
+if test -z "$FLAKE8"; then
+ AC_MSG_WARN(['flake8' binary is required to check python code style])
+fi
AC_PATH_PROG([PERL], [perl])
if test -z "$PERL"; then
AC_MSG_ERROR(['perl' binary is required to build libvirt])