[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/19] qapi: Polish reporting of bogus member documentation
From: |
Markus Armbruster |
Subject: |
[PATCH 18/19] qapi: Polish reporting of bogus member documentation |
Date: |
Thu, 24 Oct 2019 13:02:36 +0200 |
Improve error messages from
the following documented members are not in the declaration: a
the following documented members are not in the declaration: aa, bb
to the more concise
documented member 'a' does not exist
documented members 'aa', 'bb' do not exist
Signed-off-by: Markus Armbruster <address@hidden>
---
scripts/qapi/parser.py | 6 ++++--
tests/qapi-schema/doc-bad-alternate-member.err | 2 +-
tests/qapi-schema/doc-bad-boxed-command-arg.err | 2 +-
tests/qapi-schema/doc-bad-command-arg.err | 2 +-
tests/qapi-schema/doc-bad-enum-member.err | 2 +-
tests/qapi-schema/doc-bad-event-arg.err | 2 +-
tests/qapi-schema/doc-bad-union-member.err | 2 +-
7 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index e800876ad1..6c45a00cf4 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -566,5 +566,7 @@ class QAPIDoc(object):
if bogus:
raise QAPISemError(
self.info,
- "the following documented members are not in "
- "the declaration: %s" % ", ".join(bogus))
+ "documented member%s '%s' %s not exist"
+ % ("s" if len(bogus) > 1 else "",
+ "', '".join(bogus),
+ "do" if len(bogus) > 1 else "does"))
diff --git a/tests/qapi-schema/doc-bad-alternate-member.err
b/tests/qapi-schema/doc-bad-alternate-member.err
index a1c282f935..d7286bb57c 100644
--- a/tests/qapi-schema/doc-bad-alternate-member.err
+++ b/tests/qapi-schema/doc-bad-alternate-member.err
@@ -1 +1 @@
-doc-bad-alternate-member.json:3: the following documented members are not in
the declaration: aa, bb
+doc-bad-alternate-member.json:3: documented members 'aa', 'bb' do not exist
diff --git a/tests/qapi-schema/doc-bad-boxed-command-arg.err
b/tests/qapi-schema/doc-bad-boxed-command-arg.err
index e1101b1667..7137af3ec9 100644
--- a/tests/qapi-schema/doc-bad-boxed-command-arg.err
+++ b/tests/qapi-schema/doc-bad-boxed-command-arg.err
@@ -1 +1 @@
-doc-bad-boxed-command-arg.json:9: the following documented members are not in
the declaration: a
+doc-bad-boxed-command-arg.json:9: documented member 'a' does not exist
diff --git a/tests/qapi-schema/doc-bad-command-arg.err
b/tests/qapi-schema/doc-bad-command-arg.err
index 153ea0330a..18ed076cef 100644
--- a/tests/qapi-schema/doc-bad-command-arg.err
+++ b/tests/qapi-schema/doc-bad-command-arg.err
@@ -1 +1 @@
-doc-bad-command-arg.json:3: the following documented members are not in the
declaration: b
+doc-bad-command-arg.json:3: documented member 'b' does not exist
diff --git a/tests/qapi-schema/doc-bad-enum-member.err
b/tests/qapi-schema/doc-bad-enum-member.err
index dfa1e786d7..7efeb47363 100644
--- a/tests/qapi-schema/doc-bad-enum-member.err
+++ b/tests/qapi-schema/doc-bad-enum-member.err
@@ -1 +1 @@
-doc-bad-enum-member.json:3: the following documented members are not in the
declaration: a
+doc-bad-enum-member.json:3: documented member 'a' does not exist
diff --git a/tests/qapi-schema/doc-bad-event-arg.err
b/tests/qapi-schema/doc-bad-event-arg.err
index 114ff4a3c7..d13cacf21f 100644
--- a/tests/qapi-schema/doc-bad-event-arg.err
+++ b/tests/qapi-schema/doc-bad-event-arg.err
@@ -1 +1 @@
-doc-bad-event-arg.json:3: the following documented members are not in the
declaration: a
+doc-bad-event-arg.json:3: documented member 'a' does not exist
diff --git a/tests/qapi-schema/doc-bad-union-member.err
b/tests/qapi-schema/doc-bad-union-member.err
index 8b9d36eab1..6dd2726a65 100644
--- a/tests/qapi-schema/doc-bad-union-member.err
+++ b/tests/qapi-schema/doc-bad-union-member.err
@@ -1 +1 @@
-doc-bad-union-member.json:3: the following documented members are not in the
declaration: a, b
+doc-bad-union-member.json:3: documented members 'a', 'b' do not exist
--
2.21.0
- [PATCH 00/19] qapi: Doc generation fixes, Markus Armbruster, 2019/10/24
- [PATCH 01/19] tests/qapi-schema: Demonstrate feature and enum doc comment bugs, Markus Armbruster, 2019/10/24
- [PATCH 13/19] qapi: Eliminate .check_doc() overrides, Markus Armbruster, 2019/10/24
- [PATCH 16/19] qapi: Fold normalize_enum() into check_enum(), Markus Armbruster, 2019/10/24
- [PATCH 12/19] qapi: Simplify ._make_implicit_object_type(), Markus Armbruster, 2019/10/24
- [PATCH 05/19] qemu-doc: Belatedly document QMP command deprecation, Markus Armbruster, 2019/10/24
- [PATCH 10/19] qapi: Clean up doc comment checking for implicit union base, Markus Armbruster, 2019/10/24
- [PATCH 08/19] qapi: Split .connect_doc(), .check_doc() off .check(), Markus Armbruster, 2019/10/24
- [PATCH 18/19] qapi: Polish reporting of bogus member documentation,
Markus Armbruster <=
- [PATCH 04/19] tests/qapi-schema: Fix feature documentation testing, Markus Armbruster, 2019/10/24
- [PATCH 03/19] tests/qapi-schema: Cover alternate documentation comments, Markus Armbruster, 2019/10/24
- [PATCH 09/19] qapi: Fix enum doc comment checking, Markus Armbruster, 2019/10/24
- [PATCH 07/19] qapi: De-duplicate entity documentation generation code, Markus Armbruster, 2019/10/24
- [PATCH 11/19] qapi: Fix doc comment checking for commands and events, Markus Armbruster, 2019/10/24
- [PATCH 15/19] qapi: Fold normalize_features() into check_features(), Markus Armbruster, 2019/10/24
- [PATCH 02/19] tests/qapi-schema: Demonstrate command and event doc comment bugs, Markus Armbruster, 2019/10/24
- [PATCH 19/19] qapi: Check feature documentation against the schema, Markus Armbruster, 2019/10/24
- [PATCH 14/19] qapi: Fold normalize_if() into check_if(), Markus Armbruster, 2019/10/24
- [PATCH 17/19] qapi: Lift features into QAPISchemaEntity, Markus Armbruster, 2019/10/24