[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 20/25] qapi: Improve reporting of missing / unknown definitio
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 20/25] qapi: Improve reporting of missing / unknown definition keys |
Date: |
Tue, 24 Sep 2019 22:46:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 9/24/19 8:28 AM, Markus Armbruster wrote:
>> Have check_exprs() call check_keys() later, so its error messages gain
>> an "in definition" line.
>>
>> Both check_keys() and check_name_is_str() check the definition's name
>> is a string. Since check_keys() now runs after check_name_is_str()
>> rather than before, its check is dead. Bury it. Checking values in
>> check_keys() is unclean anyway.
>>
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>
>> +++ b/scripts/qapi/common.py
>> @@ -905,8 +905,6 @@ def check_known_keys(value, info, source, required,
>> optional):
>>
>> def check_keys(expr, info, meta, required, optional=[]):
>> name = expr[meta]
>> - if not isinstance(name, str):
>> - raise QAPISemError(info, "'%s' key must have a string value" % meta)
>
> Should this be replaced with an assert? But I'm also okay just dropping
> it, since our testsuite shows that we still flag the problems that this
> message was originally used for.
I'd prefer not to assert, because as of this patch, check_keys() *only*
checks keys, just like its name suggests.
> Reviewed-by: Eric Blake <address@hidden>
Thanks!
- Re: [PATCH 18/25] qapi: Improve reporting of invalid 'if' errors, (continued)
- [PATCH 12/25] qapi: Move check for reserved names out of add_name(), Markus Armbruster, 2019/09/24
- [PATCH 22/25] qapi: Eliminate check_keys(), rename check_known_keys(), Markus Armbruster, 2019/09/24
- [PATCH 19/25] qapi: Improve reporting of invalid flags, Markus Armbruster, 2019/09/24
- [PATCH 20/25] qapi: Improve reporting of missing / unknown definition keys, Markus Armbruster, 2019/09/24
- [PATCH 05/25] qapi: Clean up member name case checking, Markus Armbruster, 2019/09/24
- [PATCH 23/25] qapi: Improve reporting of missing documentation comment, Markus Armbruster, 2019/09/24
- [PATCH 09/25] qapi: Improve reporting of invalid name errors, Markus Armbruster, 2019/09/24
- [PATCH 25/25] qapi: Improve source file read error handling, Markus Armbruster, 2019/09/24