qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: Michael Roth <michael.roth@amd.com>,
	Cleber Rosa <crosa@redhat.com>,
	qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH 1/6] qapi/parser.py: remove unused check_args_section arguments
Date: Thu, 20 May 2021 16:27:17 +0200	[thread overview]
Message-ID: <8735uh5vlm.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20210519191718.3950330-2-jsnow@redhat.com> (John Snow's message of "Wed, 19 May 2021 15:17:13 -0400")

John Snow <jsnow@redhat.com> writes:

> (Addresses a pylint warning.)
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  scripts/qapi/parser.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
> index 06167ed3e0a..b3a468504fc 100644
> --- a/scripts/qapi/parser.py
> +++ b/scripts/qapi/parser.py
> @@ -753,7 +753,7 @@ def check_expr(self, expr):
>  
>      def check(self):
>  
> -        def check_args_section(args, info, what):
> +        def check_args_section(args):
>              bogus = [name for name, section in args.items()
>                       if not section.member]
>              if bogus:
> @@ -764,5 +764,5 @@ def check_args_section(args, info, what):
>                         "', '".join(bogus),
>                         "do" if len(bogus) > 1 else "does"))
>  
> -        check_args_section(self.args, self.info, 'members')
> -        check_args_section(self.features, self.info, 'features')
> +        check_args_section(self.args)
> +        check_args_section(self.features)

I messed this up in commit e151941d1b "qapi: Check feature documentation
against the schema".

I "obviously" meant to use @info, but used self.info instead.  Dropping
@info is fine.

I "obviously" meant to use @what in the error message, but hardcoded
"member" instead, resulting in a confusing error message when it's about
features.  Test case qapi-schema/doc-bad-feature.json shows it:

    $ cat tests/qapi-schema/doc-bad-feature.json 
    # Features listed in the doc comment must exist in the actual schema

    ##
    # @foo:
    #
    # Features:
    # @a: a
    ##
    { 'command': 'foo' }
    $ cat tests/qapi-schema/doc-bad-feature.err 
    doc-bad-feature.json:3: documented member 'a' does not exist

Instead of dropping what, let's put it to use to improve this error
message.



  reply	other threads:[~2021-05-20 14:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 19:17 [PATCH 0/6] qapi: static typing conversion, pt5b John Snow
2021-05-19 19:17 ` [PATCH 1/6] qapi/parser.py: remove unused check_args_section arguments John Snow
2021-05-20 14:27   ` Markus Armbruster [this message]
2021-05-19 19:17 ` [PATCH 2/6] qapi/parser: Allow empty QAPIDoc Sections John Snow
2021-05-20 14:42   ` Markus Armbruster
2021-05-20 22:23     ` John Snow
2021-05-21  5:35       ` Markus Armbruster
2021-05-21 15:55         ` John Snow
2021-06-11 14:40           ` Markus Armbruster
2021-06-11 17:21             ` John Snow
2021-05-19 19:17 ` [PATCH 3/6] qapi/parser.py: add type hint annotations (QAPIDoc) John Snow
2021-05-20 15:05   ` Markus Armbruster
2021-05-20 22:48     ` John Snow
2021-05-21  6:05       ` Markus Armbruster
2021-05-19 19:17 ` [PATCH 4/6] qapi/parser.py: enable mypy checks John Snow
2021-05-19 19:17 ` [PATCH 5/6] qapi/parser.py: Silence too-few-public-methods warning John Snow
2021-05-19 19:17 ` [PATCH 6/6] qapi/parser.py: enable pylint checks John Snow

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=8735uh5vlm.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=qemu-devel@nongnu.org \
    /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).