[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 03/13] qapi/parser: fix unused check_args_section arguments
From: |
John Snow |
Subject: |
[PATCH v3 03/13] qapi/parser: fix unused check_args_section arguments |
Date: |
Wed, 29 Sep 2021 15:44:18 -0400 |
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>
---
scripts/qapi/parser.py | 16 +++++++++-------
tests/qapi-schema/doc-bad-feature.err | 2 +-
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index f03ba2cfec8..bfd2dbfd9a2 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -753,16 +753,18 @@ def check_expr(self, expr):
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"))
+ "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, self.info, 'members')
- check_args_section(self.features, self.info, 'features')
+ check_args_section(self.args, 'member')
+ check_args_section(self.features, 'feature')
diff --git a/tests/qapi-schema/doc-bad-feature.err
b/tests/qapi-schema/doc-bad-feature.err
index e4c62adfa3e..49d1746c3d1 100644
--- a/tests/qapi-schema/doc-bad-feature.err
+++ b/tests/qapi-schema/doc-bad-feature.err
@@ -1 +1 @@
-doc-bad-feature.json:3: documented member 'a' does not exist
+doc-bad-feature.json:3: documented feature 'a' does not exist
--
2.31.1
- [PATCH v3 00/13] qapi: static typing conversion, pt5b, John Snow, 2021/09/29
- [PATCH v3 01/13] qapi/pylintrc: ignore 'consider-using-f-string' warning, John Snow, 2021/09/29
- [PATCH v3 02/13] qapi/gen: use dict.items() to iterate over _modules, John Snow, 2021/09/29
- [PATCH v3 03/13] qapi/parser: fix unused check_args_section arguments,
John Snow <=
- [PATCH v3 04/13] qapi: Add spaces after symbol declaration for consistency, John Snow, 2021/09/29
- [PATCH v3 06/13] qapi/parser: remove FIXME comment from _append_body_line, John Snow, 2021/09/29
- [PATCH v3 05/13] qapi/parser: improve detection of '@symbol:' preface, John Snow, 2021/09/29
- [PATCH v3 07/13] qapi/parser: Simplify _end_section(), John Snow, 2021/09/29
- [PATCH v3 08/13] qapi/parser: Introduce NullSection, John Snow, 2021/09/29