Skip to contentSkip to conversation

qapi: Minor fixes around feature names

PATCH In review Markus Armbruster 1 participant 4 messages May 10, 2022 – May 16, 2022

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
---
 scripts/qapi/expr.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qapi/expr.py +1 -1
index 48578e1698..5a1782b57e 100644
@@ -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
#2 lore raw

PATCH 2/2 docs/devel/qapi-code-gen: Belatedly document feature naming rules

In reply to Markus Armbruster
---
 docs/devel/qapi-code-gen.rst | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
docs/devel/qapi-code-gen.rst +5 -4
index 7b968433a6..cd9b544376 100644
@@ -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