aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-03-23 10:40:25 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-03-23 22:31:53 +0100
commitd83b47646ec2bdf4f7be9c2078f1bcbbb0544b2e (patch)
tree03ea4debaeddf5cf4339facbbcd69e58f30e3a5a /scripts
parent407efbf9e776ade8e8d09b778851834f91b225a1 (diff)
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]
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi/expr.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
index d968609c48..540b3982b1 100644
--- a/scripts/qapi/expr.py
+++ b/scripts/qapi/expr.py
@@ -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)