qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 07/19] qapi: Use quotes more consistently in fro


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 07/19] qapi: Use quotes more consistently in frontend error messages
Date: Tue, 17 Sep 2019 12:52:38 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 9/14/19 10:34 AM, Markus Armbruster wrote:
> Consistently enclose error messages in double quotes.  Use single
> quotes within, except for one case of "'".
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---

> +++ b/scripts/qapi/common.py
> @@ -214,7 +214,7 @@ class QAPIDoc(object):
>          # recognized, and get silently treated as ordinary text
>          if not self.symbol and not self.body.text and line.startswith('@'):
>              if not line.endswith(':'):
> -                raise QAPIParseError(self._parser, "Line should end with :")
> +                raise QAPIParseError(self._parser, "Line should end with 
> ':'")

Makes it more obvious what belongs in the .json file (where we DO want
the use of ''), so this looks nicer.


> @@ -522,7 +522,7 @@ class QAPISchemaParser(object):
>                      ch = self.src[self.cursor]
>                      self.cursor += 1
>                      if ch == '\n':
> -                        raise QAPIParseError(self, 'Missing terminating 
> "\'"')
> +                        raise QAPIParseError(self, "Missing terminating 
> \"'\"")

And this would be the one exception mentioned in the commit message.


> @@ -592,20 +592,20 @@ class QAPISchemaParser(object):
>              self.accept()
>              return expr
>          if self.tok not in "{['tfn":
> -            raise QAPIParseError(self, 'Expected "{", "[", "]", string, '
> -                                 'boolean or "null"')
> +            raise QAPIParseError(
> +                self, "Expected '{', '[', ']', string, boolean or 'null'")

Definite improvement here.

Reviewed-by: Eric Blake <address@hidden>

And of course, you can correlate which tests changed output to a measure
of how well we've covered the various error paths.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]