diff options
author | Markus Armbruster <armbru@redhat.com> | 2021-03-23 10:40:23 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-03-23 22:31:43 +0100 |
commit | 5aceeac04de50e3a9d5c2a965379324659a94be0 (patch) | |
tree | dc467a25f992c721e8dd87fc2a1533809fbcf468 /scripts | |
parent | e75d4225b76842ec899f25e8ff39b070119f033f (diff) |
qapi: Enforce struct member naming rules
Struct members, including command arguments, event data, and union
inline base members, should use '-', not '_'. Enforce this. Fix the
fixable offenders (all in tests/), and add the remainder to pragma
member-name-exceptions.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-27-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/qapi/expr.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index 9193e68763..ba9f7ad350 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -184,7 +184,7 @@ def check_type(value, info, source, raise QAPISemError(info, "%s should be an object or type name" % source) - permit_upper = allow_dict in info.pragma.member_name_exceptions + permissive = allow_dict in info.pragma.member_name_exceptions # value is a dictionary, check that each member is okay for (key, arg) in value.items(): @@ -192,7 +192,8 @@ def check_type(value, info, source, if key.startswith('*'): key = key[1:] check_name_lower(key, info, key_source, - permit_upper, permit_underscore=True) + permit_upper=permissive, + permit_underscore=permissive) if c_name(key, False) == 'u' or c_name(key, False).startswith('has_'): raise QAPISemError(info, "%s uses reserved name" % key_source) check_keys(arg, info, key_source, ['type'], ['if', 'features']) |