qapi: Minor fixes around feature names
cover qapi: Minor fixes around feature names
Markus Armbruster (2):
qapi/expr: Enforce feature naming rules again docs/devel/qapi-code-gen: Belatedly document feature naming rules
docs/devel/qapi-code-gen.rst | 9 +++++---- scripts/qapi/expr.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
2.35.1
PATCH 1/2 qapi/expr: Enforce feature naming rules again
Commit e42648dccd "qapi/expr.py: Remove single-letter variable" accidentally removed the check for "only lower case letters and hyphens". Restore it.
Fixes e42648dccdd1defe8f35f247966cd7283f865cd6
Signed-off-by Markus Armbruster <[email protected]>
--- scripts/qapi/expr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qapi/expr.py +1 -1
@@ -443,7 +443,7 @@ def check_features(features: Optional[object], check_keys(feat, info, source, ['name'], ['if']) check_name_is_str(feat['name'], info, source) source = "%s '%s'" % (source, feat['name']) - check_name_str(feat['name'], info, source) + check_name_lower(feat['name'], info, source) check_if(feat, info, source)
Signature · 1 line
2.35.1
PATCH 2/2 docs/devel/qapi-code-gen: Belatedly document feature naming rules
In reply to Markus ArmbrusterSigned-off-by Markus Armbruster <[email protected]>
--- docs/devel/qapi-code-gen.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
docs/devel/qapi-code-gen.rst +5 -4
@@ -739,10 +739,11 @@ Type names ending with ``Kind`` or ``List`` are reserved for the generator, which uses them for implicit union enums and array types, respectively. -Command names, and member names within a type, should be all lower -case with words separated by a hyphen. However, some existing older -commands and complex types use underscore; when extending them, -consistency is preferred over blindly avoiding underscore. +Command names, member names within a type, and feature names should be +all lower case with words separated by a hyphen. However, some +existing older commands and complex types use underscore; when +extending them, consistency is preferred over blindly avoiding +underscore. Event names should be ALL_CAPS with words separated by underscore.
Signature · 1 line
2.35.1
Queued.