[libvirt PATCH 0/3] Run more syntax checks

Some were left out during the meson conversion. Ján Tomko (3): config.h: add a copyright blurb build-aux: set the PYTHON variable in the Makefile build-aux: add sc_ prefix to more syntax checks build-aux/Makefile.in | 1 + build-aux/meson.build | 1 + build-aux/syntax-check.mk | 18 +++++++++--------- config.h | 18 ++++++++++++++++++ 4 files changed, 29 insertions(+), 9 deletions(-) -- 2.26.2

And #pragma once, to appease syntax-check. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- config.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config.h b/config.h index 368688f3d0..0f12b728b6 100644 --- a/config.h +++ b/config.h @@ -1,3 +1,21 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#pragma once + #include <meson-config.h> /* Enable compile-time and run-time bounds-checking, and some warnings, -- 2.26.2

Some syntax-check rules rely on this variable. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- build-aux/Makefile.in | 1 + build-aux/meson.build | 1 + 2 files changed, 2 insertions(+) diff --git a/build-aux/Makefile.in b/build-aux/Makefile.in index 601f1ad7a1..c4caa95467 100644 --- a/build-aux/Makefile.in +++ b/build-aux/Makefile.in @@ -4,6 +4,7 @@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ FLAKE8 = @flake8_path@ RUNUTF8 = @runutf8@ +PYTHON = @PYTHON@ # include syntax-check.mk file include $(top_srcdir)/build-aux/syntax-check.mk diff --git a/build-aux/meson.build b/build-aux/meson.build index 1dd85b889b..8432e7bf3a 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -8,6 +8,7 @@ if flake8_prog.found() endif syntax_check_conf.set('flake8_path', flake8_path) syntax_check_conf.set('runutf8', ' '.join(runutf8)) +syntax_check_conf.set('PYTHON', python3_prog.path()) configure_file( input: 'Makefile.in', -- 2.26.2

On Mon, Aug 03, 2020 at 11:59:23AM +0200, Ján Tomko wrote:
Some syntax-check rules rely on this variable.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- build-aux/Makefile.in | 1 + build-aux/meson.build | 1 + 2 files changed, 2 insertions(+)
diff --git a/build-aux/Makefile.in b/build-aux/Makefile.in index 601f1ad7a1..c4caa95467 100644 --- a/build-aux/Makefile.in +++ b/build-aux/Makefile.in @@ -4,6 +4,7 @@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ FLAKE8 = @flake8_path@ RUNUTF8 = @runutf8@ +PYTHON = @PYTHON@
# include syntax-check.mk file include $(top_srcdir)/build-aux/syntax-check.mk diff --git a/build-aux/meson.build b/build-aux/meson.build index 1dd85b889b..8432e7bf3a 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -8,6 +8,7 @@ if flake8_prog.found() endif syntax_check_conf.set('flake8_path', flake8_path) syntax_check_conf.set('runutf8', ' '.join(runutf8)) +syntax_check_conf.set('PYTHON', python3_prog.path())
I would go with PYTHON3 to make it consistent with how we generate meson-config.h where we use PYTHON3 as well.

That way our meson build file will correctly pick them up. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- build-aux/syntax-check.mk | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 1fe2da4e63..9256532ab3 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1874,9 +1874,9 @@ sc_prohibit_path_max_allocation: $(_sc_search_regexp) ifneq ($(_gl-Makefile),) -syntax-check: spacing-check test-wrap-argv \ - prohibit-duplicate-header mock-noinline group-qemu-caps \ - header-ifdef +syntax-check: sc_spacing-check sc_test-wrap-argv \ + sc_prohibit-duplicate-header sc_mock-noinline sc_group-qemu-caps \ + sc_header-ifdef @if ! cppi --version >/dev/null 2>&1; then \ echo "*****************************************************" >&2; \ echo "* cppi not installed, some checks have been skipped *" >&2; \ @@ -1890,28 +1890,28 @@ syntax-check: spacing-check test-wrap-argv \ endif # Don't include duplicate header in the source (either *.c or *.h) -prohibit-duplicate-header: +sc_prohibit-duplicate-header: $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.[chx]$$' | $(RUNUTF8) xargs \ $(PYTHON) $(top_srcdir)/scripts/prohibit-duplicate-header.py -spacing-check: +sc_spacing-check: $(AM_V_GEN)$(VC_LIST) | $(GREP) '\.c$$' | xargs \ $(PERL) $(top_srcdir)/build-aux/check-spacing.pl || \ { echo '$(ME): incorrect formatting' 1>&2; exit 1; } -mock-noinline: +sc_mock-noinline: $(AM_V_GEN)$(VC_LIST) | $(GREP) '\.[ch]$$' | $(RUNUTF8) xargs \ $(PYTHON) $(top_srcdir)/scripts/mock-noinline.py -header-ifdef: +sc_header-ifdef: $(AM_V_GEN)$(VC_LIST) | $(GREP) '\.[h]$$' | $(RUNUTF8) xargs \ $(PYTHON) $(top_srcdir)/scripts/header-ifdef.py -test-wrap-argv: +sc_test-wrap-argv: $(AM_V_GEN)$(VC_LIST) | $(GREP) -E '\.(ldargs|args)' | $(RUNUTF8) xargs \ $(PYTHON) $(top_srcdir)/scripts/test-wrap-argv.py --check -group-qemu-caps: +sc_group-qemu-caps: $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/group-qemu-caps.py \ --check --prefix $(top_srcdir)/ -- 2.26.2

On Mon, Aug 03, 2020 at 11:59:21AM +0200, Ján Tomko wrote:
Some were left out during the meson conversion.
Ján Tomko (3): config.h: add a copyright blurb build-aux: set the PYTHON variable in the Makefile build-aux: add sc_ prefix to more syntax checks
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> with the comment for patch 2 addressed.
participants (2)
-
Ján Tomko
-
Pavel Hrdina