[libvirt] [dbus PATCH 0/3] Fix and improve syntax-check

Andrea Bolognani (3): tests: Point flake8 to the files it needs to check configure: Detect flake8 automatically configure: Find flake8 on FreeBSD Makefile.am | 2 +- configure.ac | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.17.1

Recent versions of the tool will look for Python scripts on their own, but when performing a VPATH build it's very likely the resulting list will be empty and nothing will actually be checked. Point flake8 to the files explicitly to avoid the issue. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index cf7994e..a0696bf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,6 +46,6 @@ gen-AUTHORS: # E501: (line too long) warning is ignored. .PHONY: flake8 flake8: - flake8 --show-source --ignore=E501 + flake8 --show-source --ignore=E501 $(srcdir)/tests/*.py syntax-check: flake8 -- 2.17.1

On Tue, Aug 14, 2018 at 05:30:44PM +0200, Andrea Bolognani wrote:
Recent versions of the tool will look for Python scripts on their own, but when performing a VPATH build it's very likely the resulting list will be empty and nothing will actually be checked. Point flake8 to the files explicitly to avoid the issue.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am index cf7994e..a0696bf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,6 +46,6 @@ gen-AUTHORS: # E501: (line too long) warning is ignored. .PHONY: flake8 flake8: - flake8 --show-source --ignore=E501 + flake8 --show-source --ignore=E501 $(srcdir)/tests/*.py
It would be nice to catch any possible .py files in different directories, so $(srcdir) should be enough.
syntax-check: flake8 -- 2.17.1
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

This also allows the user to run a custom flake8 by setting FLAKE8 in the environment. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Makefile.am | 2 +- configure.ac | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index a0696bf..c6d09e6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,6 +46,6 @@ gen-AUTHORS: # E501: (line too long) warning is ignored. .PHONY: flake8 flake8: - flake8 --show-source --ignore=E501 $(srcdir)/tests/*.py + $(FLAKE8) --show-source --ignore=E501 $(srcdir)/tests/*.py; syntax-check: flake8 diff --git a/configure.ac b/configure.ac index 1c0e246..8722255 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,7 @@ AC_PROG_MKDIR_P AM_PROG_CC_C_O AC_PROG_CC_STDC AC_PROG_LIBTOOL +AC_PATH_PROGS([FLAKE8], [flake8]) PKG_CHECK_MODULES([GIO2], [gio-unix-2.0 >= $GLIB2_REQUIRED]) PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED]) -- 2.17.1

On Tuesday, 14 August 2018 17:30:45 CEST Andrea Bolognani wrote:
This also allows the user to run a custom flake8 by setting FLAKE8 in the environment.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Makefile.am | 2 +- configure.ac | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am index a0696bf..c6d09e6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,6 +46,6 @@ gen-AUTHORS: # E501: (line too long) warning is ignored. .PHONY: flake8 flake8: - flake8 --show-source --ignore=E501 $(srcdir)/tests/*.py + $(FLAKE8) --show-source --ignore=E501 $(srcdir)/tests/*.py;
Extra ';' at the end of this line. -- Pino Toscano

The newest version available from ports at the moment is built against Python 3.6 and is thus installed as flake8-3.6 on the platform. This makes syntax-check work out of the box on FreeBSD. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8722255..ccb02a4 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ AC_PROG_MKDIR_P AM_PROG_CC_C_O AC_PROG_CC_STDC AC_PROG_LIBTOOL -AC_PATH_PROGS([FLAKE8], [flake8]) +AC_PATH_PROGS([FLAKE8], [flake8 flake8-3.6]) PKG_CHECK_MODULES([GIO2], [gio-unix-2.0 >= $GLIB2_REQUIRED]) PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED]) -- 2.17.1

On Tue, Aug 14, 2018 at 05:30:43PM +0200, Andrea Bolognani wrote:
Andrea Bolognani (3): tests: Point flake8 to the files it needs to check configure: Detect flake8 automatically configure: Find flake8 on FreeBSD
Makefile.am | 2 +- configure.ac | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (3)
-
Andrea Bolognani
-
Ján Tomko
-
Pino Toscano