From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [PATCH v2 1/7] tests: introduce tree-wide code style checking
Date: Mon, 4 Jul 2022 17:12:49 +0100 [thread overview]
Message-ID: <YsMRgUjJthbRS5qT@redhat.com> (raw)
In-Reply-To: <CAFEAcA__aTeaeB8JbMQdUz=4_6W8J5m0wOsYWBgj3RLrm=G_uQ@mail.gmail.com>
On Mon, Jul 04, 2022 at 04:46:53PM +0100, Peter Maydell wrote:
> On Mon, 4 Jul 2022 at 16:23, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > Historically QEMU has used the 'scripts/checkpatch.pl' script to
> > validate various style rules but there are a number of issues:
>
> > meson.build | 3 +
> > tests/Makefile.include | 3 +-
> > tests/meson.build | 19 +++
> > tests/style-excludes.mak | 4 +
> > tests/style-infra.mak | 265 +++++++++++++++++++++++++++++++++++++++
> > tests/style.mak | 24 ++++
>
> From my point of view the main issue with checkpatch.pl is
> that nobody in the QEMU developers particularly understands
> it or is enthusiastic about trying to add more tests to it
> or adjust the existing ones where QEMU style diverges from
> the kernel style (but nor are we tracking and upgrading to
> newer versions of the kernel's script).
>
> This seems to be aiming to replace a complex and hard to
> understand perl script with a complex and hard to understand
> makefile. I can't say I'm terribly enthusiastic :-/
I think the downsides comapred here are rather different orders of
magnitude. The checkpatch.pl script is 3000 lines of code where we
have years of experiance that no one in QEMU likes touching it.
The makefile here is 265 lines of which 50% is comments of license
text. In terms of what contributors most care about though, is
how you add new rules, and most of the time that's involves just
adding a 3 line make rule based off a regex to match the code
pattern you want to prohibit. Some of this is a bit crufty to
look at, but we've got years of experiance in libvirt with many
contributors frequently adding new tests.
It only gets hairy if the pattern you're trying to forbid needs
to match across multiple lines of text - hence the difference in
complexity between matching 'osdep.h' exists in .c, vs 'osdep.h'
exists as the very first #include. IME, the single-line matches
are most typical need that is addressed.
So while I wont claim this proposal is perfect, IMHO this would
be a significant step fowards over checkpatch.pl.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2022-07-04 16:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 15:22 [PATCH v2 0/7] tests: introduce a tree-wide code style checking facility Daniel P. Berrangé
2022-07-04 15:22 ` [PATCH v2 1/7] tests: introduce tree-wide code style checking Daniel P. Berrangé
2022-07-04 15:46 ` Peter Maydell
2022-07-04 16:12 ` Daniel P. Berrangé [this message]
2022-07-07 16:43 ` Daniel P. Berrangé
2022-07-04 15:22 ` [PATCH v2 2/7] misc: fix mixups of bool constants with int variables Daniel P. Berrangé
2022-07-04 15:38 ` Peter Maydell
2022-07-04 15:22 ` [PATCH v2 3/7] tests/style: check for " Daniel P. Berrangé
2022-07-04 15:23 ` [PATCH v2 4/7] misc: fix commonly doubled up words Daniel P. Berrangé
2022-07-04 15:52 ` Peter Maydell
2022-07-07 12:30 ` Daniel P. Berrangé
2022-07-07 12:35 ` Peter Maydell
2022-07-04 15:23 ` [PATCH v2 5/7] tests/style: check for " Daniel P. Berrangé
2022-07-04 15:23 ` [PATCH v2 6/7] misc: ensure qemu/osdep.h is included in all .c files Daniel P. Berrangé
2022-07-04 15:38 ` Warner Losh
2022-07-04 15:46 ` Daniel P. Berrangé
2022-07-04 16:08 ` Warner Losh
2022-07-04 15:23 ` [PATCH v2 7/7] tests/style: check " Daniel P. Berrangé
2022-07-04 15:47 ` Peter Maydell
2022-07-04 15:50 ` Daniel P. Berrangé
2022-07-04 15:55 ` Peter Maydell
2022-07-04 16:15 ` Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YsMRgUjJthbRS5qT@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=f4bug@amsat.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).