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 <arm...@redhat.com>
> ---

> +++ 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 <ebl...@redhat.com>

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