mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Enforce type naming rules
Type names should be CamelCase. Enforce this. The only offenders are in tests/. Fix them. Add test type-case to cover the new error. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-15-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Regexp simplified, new test made more robust]
This commit is contained in:
parent
d4f4cae8de
commit
3e6c8a6331
22 changed files with 30 additions and 24 deletions
|
@ -61,7 +61,8 @@ def check_name_lower(name, info, source,
|
|||
|
||||
def check_name_camel(name, info, source):
|
||||
stem = check_name_str(name, info, source)
|
||||
# TODO reject '[_-]' in stem, require CamelCase
|
||||
if not re.match(r'[A-Z][A-Za-z0-9]*[a-z][A-Za-z0-9]*$', stem):
|
||||
raise QAPISemError(info, "name of %s must use CamelCase" % source)
|
||||
|
||||
|
||||
def check_defn_name_str(name, info, meta):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue