[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/9] tests: introduce tree-wide code style checking
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 1/9] tests: introduce tree-wide code style checking |
Date: |
Wed, 20 Jul 2022 18:38:49 +0100 |
On Wed, 20 Jul 2022 at 18:08, Eric Blake <eblake@redhat.com> wrote:
>
> On Wed, Jul 20, 2022 at 05:31:52PM +0100, Daniel P. Berrangé wrote:
> > > > diff --git a/meson.build b/meson.build
> > > > index 65a885ea69..d8ef24bacb 100644
> > > > --- a/meson.build
> > > > +++ b/meson.build
> > > > @@ -18,6 +18,8 @@ config_host = keyval.load(meson.current_build_dir() /
> > > > 'config-host.mak')
> > > > enable_modules = 'CONFIG_MODULES' in config_host
> > > > enable_static = 'CONFIG_STATIC' in config_host
> > > >
> > > > +in_gitrepo = run_command('test', '-d', '.git', check:
> > > > false).returncode() == 0
> > >
> > > Should we use Meson's fs.is_dir() rather than running a shell?
> > > (https://mesonbuild.com/Fs-module.html)
> >
> > Will investigate
>
> Probably not a good idea as-is; .git need not be a directory, but can
> also be a symlink. So 'test -e .git' is the better check (see
> scripts/qemu-version.sh); but if you can write an existence check in
> meson (instead of a directory check), then go for it.
There is a fs.exists(), yes. I just suggested .is_dir() because
the code as written here is doing a -d check, not a -e check.
-- PMM
[PATCH v3 9/9] tests/style: check qemu/osdep.h is NOT included in all .h/.c.inc files, Daniel P . Berrangé, 2022/07/07
[PATCH v3 6/9] misc: ensure qemu/osdep.h is included first in all .c files, Daniel P . Berrangé, 2022/07/07
[PATCH v3 3/9] tests/style: check for mixups of bool constants with int variables, Daniel P . Berrangé, 2022/07/07
[PATCH v3 5/9] tests/style: check for commonly doubled up words, Daniel P . Berrangé, 2022/07/07