maint: Use flake8 to check python code

Replace 'sc_prohibit_semicolon_at_eol_in_python' with generic 'sc_flake8' rule
to check python code style.

Now 'sc_flake8' just check the error E703: 'statement ends with a semicolon'.
In future, we could use '--select' to introduce more rules.

Signed-off-by: Shi Lei <shi_lei@massclouds.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Shi Lei
2019-09-18 12:19:43 +08:00
committed by Ján Tomko
parent caa1b711e8
commit bc1e4389f5
2 changed files with 16 additions and 5 deletions

View File

@@ -704,6 +704,10 @@ AC_PATH_PROGS([PYTHON], [python3 python2 python])
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])