qapi/parser: fix unused check_args_section arguments
authorJohn Snow <jsnow@redhat.com>
Thu, 30 Sep 2021 20:57:06 +0000 (16:57 -0400)
committerMarkus Armbruster <armbru@redhat.com>
Sat, 2 Oct 2021 05:33:41 +0000 (07:33 +0200)
Pylint informs us we're not using these arguments. Oops, it's
right. Correct the error message and remove the remaining unused
parameter.

Fix test output now that the error message is improved.

Fixes: e151941d1b
Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210930205716.1148693-4-jsnow@redhat.com>
[Commit message formatting tweaked]
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/parser.py
tests/qapi-schema/doc-bad-feature.err

index f03ba2cfec8288bf24fe8b6cfaabde964a8ec2a2..bfd2dbfd9a2812315d2a9af1c9d11feeac235c3c 100644 (file)
@@ -753,16 +753,18 @@ class QAPIDoc:
 
     def check(self):
 
-        def check_args_section(args, info, what):
+        def check_args_section(args, what):
             bogus = [name for name, section in args.items()
                      if not section.member]
             if bogus:
                 raise QAPISemError(
                     self.info,
-                    "documented member%s '%s' %s not exist"
-                    % ("s" if len(bogus) > 1 else "",
-                       "', '".join(bogus),
-                       "do" if len(bogus) > 1 else "does"))
-
-        check_args_section(self.args, self.info, 'members')
-        check_args_section(self.features, self.info, 'features')
+                    "documented %s%s '%s' %s not exist" % (
+                        what,
+                        "s" if len(bogus) > 1 else "",
+                        "', '".join(bogus),
+                        "do" if len(bogus) > 1 else "does"
+                    ))
+
+        check_args_section(self.args, 'member')
+        check_args_section(self.features, 'feature')
index e4c62adfa3eef3ce3be335dfc24940fedb42c24e..49d1746c3d18a81600ba8e4a82570197a4c33af8 100644 (file)
@@ -1 +1 @@
-doc-bad-feature.json:3: documented member 'a' does not exist
+doc-bad-feature.json:3: documented feature 'a' does not exist