]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qapi: Polish reporting of bogus member documentation
authorMarkus Armbruster <armbru@redhat.com>
Thu, 24 Oct 2019 11:02:36 +0000 (13:02 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 29 Oct 2019 06:35:16 +0000 (07:35 +0100)
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 <armbru@redhat.com>
Message-Id: <20191024110237.30963-19-armbru@redhat.com>

scripts/qapi/parser.py
tests/qapi-schema/doc-bad-alternate-member.err
tests/qapi-schema/doc-bad-boxed-command-arg.err
tests/qapi-schema/doc-bad-command-arg.err
tests/qapi-schema/doc-bad-enum-member.err
tests/qapi-schema/doc-bad-event-arg.err
tests/qapi-schema/doc-bad-union-member.err

index e800876ad14e5d24cd44458f2674a198c486d68a..6c45a00cf4d839db80636faa1176dfe82475d50b 100644 (file)
@@ -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"))
index a1c282f93555135a7225e4cc9a7f2c8a6b831983..d7286bb57c4005fed171fe54f19aa9cd688e5968 100644 (file)
@@ -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
index e1101b166766b2baae744b479376132237c20f30..7137af3ec921bacf324b35dd8e78ca440b2d55c8 100644 (file)
@@ -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
index 153ea0330a3395b43139cf4b8b3ae9b8d4ef6ff8..18ed076cef6cf62cc7ca3c1a737ce70a5f9fb125 100644 (file)
@@ -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
index dfa1e786d7c6acf003a15de1cfe9fc10d1215009..7efeb4736358de50b5510e53376f21d3ba183046 100644 (file)
@@ -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
index 114ff4a3c77a9b11a207a2321f2e66c6507dae22..d13cacf21f0c5ea28b326594b4304fabd7b39ac1 100644 (file)
@@ -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
index 8b9d36eab187183068587035b4269115760f9635..6dd2726a65655b7f77ea9a60012c0a16d58b569b 100644 (file)
@@ -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