[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
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 18/19] qapi: Fix excessive QAPISchemaEntity.check() recursion, (continued)
- [Qemu-devel] [PATCH 19/19] qapi: Assert .visit() and .check_clash() run only after .check(), Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 16/19] qapi: Delete useless check_exprs() code for simple union kind, Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 15/19] qapi: Clean up around check_known_keys(), Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 17/19] qapi: Fix to .check() empty structs just once, Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 07/19] qapi: Use quotes more consistently in frontend error messages, Markus Armbruster, 2019/09/14
- Re: [Qemu-devel] [PATCH 07/19] qapi: Use quotes more consistently in frontend error messages,
Eric Blake <=
- [Qemu-devel] [PATCH 09/19] qapi: Remove null from schema language, Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 13/19] qapi: Normalize 'if' in check_exprs(), like other sugar, Markus Armbruster, 2019/09/14