qapi: Enforce command naming rules

Command names should be lower-case.  Enforce this.  Fix the fixable
offenders (all in tests/), and add the remainder to pragma
command-name-exceptions.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-25-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Markus Armbruster 2021-03-23 10:40:21 +01:00
parent e744708a77
commit 05ebf841ef
8 changed files with 62 additions and 31 deletions

View file

@ -31,7 +31,7 @@
'base': { 'type': 'EnumOne' }, 'discriminator': 'type',
'data': { } }
{ 'command': 'user_def_cmd0', 'data': 'Empty2', 'returns': 'Empty2' }
{ 'command': 'user-def-cmd0', 'data': 'Empty2', 'returns': 'Empty2' }
# for testing override of default naming heuristic
{ 'enum': 'QEnumTwo',
@ -141,9 +141,9 @@
{ 'include': 'include/sub-module.json' }
# testing commands
{ 'command': 'user_def_cmd', 'data': {} }
{ 'command': 'user_def_cmd1', 'data': {'ud1a': 'UserDefOne'} }
{ 'command': 'user_def_cmd2',
{ 'command': 'user-def-cmd', 'data': {} }
{ 'command': 'user-def-cmd1', 'data': {'ud1a': 'UserDefOne'} }
{ 'command': 'user-def-cmd2',
'data': {'ud1a': {'type': 'UserDefOne'}, '*ud1b': 'UserDefOne'},
'returns': 'UserDefTwo' }
@ -230,7 +230,8 @@
'union_bar': { 'type': 'str', 'if': 'defined(TEST_IF_UNION_BAR)'} },
'if': 'defined(TEST_IF_UNION) && defined(TEST_IF_STRUCT)' }
{ 'command': 'TestIfUnionCmd', 'data': { 'union_cmd_arg': 'TestIfUnion' },
{ 'command': 'test-if-union-cmd',
'data': { 'union_cmd_arg': 'TestIfUnion' },
'if': 'defined(TEST_IF_UNION)' }
{ 'alternate': 'TestIfAlternate', 'data':
@ -238,16 +239,18 @@
'bar': { 'type': 'TestStruct', 'if': 'defined(TEST_IF_ALT_BAR)'} },
'if': 'defined(TEST_IF_ALT) && defined(TEST_IF_STRUCT)' }
{ 'command': 'TestIfAlternateCmd', 'data': { 'alt_cmd_arg': 'TestIfAlternate' },
{ 'command': 'test-if-alternate-cmd',
'data': { 'alt_cmd_arg': 'TestIfAlternate' },
'if': 'defined(TEST_IF_ALT)' }
{ 'command': 'TestIfCmd', 'data':
{ 'foo': 'TestIfStruct',
{ 'command': 'test-if-cmd',
'data': {
'foo': 'TestIfStruct',
'bar': { 'type': 'TestIfEnum', 'if': 'defined(TEST_IF_CMD_BAR)' } },
'returns': 'UserDefThree',
'if': ['defined(TEST_IF_CMD)', 'defined(TEST_IF_STRUCT)'] }
{ 'command': 'TestCmdReturnDefThree', 'returns': 'UserDefThree' }
{ 'command': 'test-cmd-return-def-three', 'returns': 'UserDefThree' }
{ 'event': 'TEST_IF_EVENT', 'data':
{ 'foo': 'TestIfStruct',