[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 14/17] qapi/expr: Only explicitly prohibit 'Kind' nor 'List' f
From: |
John Snow |
Subject: |
[PATCH v5 14/17] qapi/expr: Only explicitly prohibit 'Kind' nor 'List' for type names |
Date: |
Wed, 21 Apr 2021 14:20:29 -0400 |
Per list review: qapi-code-gen.txt reserves suffixes Kind and
List only for type names, but the code rejects them for events and
commands, too.
It turns out we reject them earlier anyway: In check_name_upper() for
event names, and in check_name_lower() for command names.
Still, adjust the code for clarity over what precisely we are guarding
against.
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/expr.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
index 5e4d5f80aa7..c33caf00d91 100644
--- a/scripts/qapi/expr.py
+++ b/scripts/qapi/expr.py
@@ -95,9 +95,9 @@ def check_defn_name_str(name: str, info: QAPISourceInfo,
meta: str) -> None:
permit_underscore=name in info.pragma.command_name_exceptions)
else:
check_name_camel(name, info, meta)
- if name.endswith('Kind') or name.endswith('List'):
- raise QAPISemError(
- info, "%s name should not end in '%s'" % (meta, name[-4:]))
+ if name.endswith('Kind') or name.endswith('List'):
+ raise QAPISemError(
+ info, "%s name should not end in '%s'" % (meta, name[-4:]))
def check_keys(value: _JSONObject,
--
2.30.2
- [PATCH v5 07/17] qapi/expr.py: Check type of union and alternate 'data' member, (continued)
- [PATCH v5 07/17] qapi/expr.py: Check type of union and alternate 'data' member, John Snow, 2021/04/21
- [PATCH v5 13/17] qapi/expr.py: enable pylint checks, John Snow, 2021/04/21
- [PATCH v5 09/17] qapi/expr.py: Modify check_keys to accept any Collection, John Snow, 2021/04/21
- [PATCH v5 04/17] qapi/expr.py: constrain incoming expression types, John Snow, 2021/04/21
- [PATCH v5 11/17] qapi/expr.py: Consolidate check_if_str calls in check_if, John Snow, 2021/04/21
- [PATCH v5 16/17] qapi/expr.py: Use tuples instead of lists for static data, John Snow, 2021/04/21
- [PATCH v5 02/17] qapi/expr.py: Remove 'info' argument from nested check_if_str, John Snow, 2021/04/21
- [PATCH v5 08/17] qapi/expr.py: Add casts in a few select cases, John Snow, 2021/04/21
- [PATCH v5 15/17] qapi/expr.py: Add docstrings, John Snow, 2021/04/21
- [PATCH v5 17/17] qapi/expr: Update authorship and copyright information, John Snow, 2021/04/21
- [PATCH v5 14/17] qapi/expr: Only explicitly prohibit 'Kind' nor 'List' for type names,
John Snow <=
- Re: [PATCH v5 00/17] qapi: static typing conversion, pt3, Markus Armbruster, 2021/04/22