mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Enforce union and alternate branch naming rules
Union branch names should use '-', not '_'. Enforce this. The only offenders are in tests/. Fix them. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-29-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Commit message typo fixed]
This commit is contained in:
parent
407efbf9e7
commit
d83b47646e
7 changed files with 15 additions and 11 deletions
|
@ -274,7 +274,7 @@ def check_union(expr, info):
|
|||
for (key, value) in members.items():
|
||||
source = "'data' member '%s'" % key
|
||||
if discriminator is None:
|
||||
check_name_lower(key, info, source, permit_underscore=True)
|
||||
check_name_lower(key, info, source)
|
||||
# else: name is in discriminator enum, which gets checked
|
||||
check_keys(value, info, source, ['type'], ['if'])
|
||||
check_if(value, info, source)
|
||||
|
@ -288,7 +288,7 @@ def check_alternate(expr, info):
|
|||
raise QAPISemError(info, "'data' must not be empty")
|
||||
for (key, value) in members.items():
|
||||
source = "'data' member '%s'" % key
|
||||
check_name_lower(key, info, source, permit_underscore=True)
|
||||
check_name_lower(key, info, source)
|
||||
check_keys(value, info, source, ['type'], ['if'])
|
||||
check_if(value, info, source)
|
||||
check_type(value['type'], info, source)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue