* [PATCH] qapi: Improve error message for description following section
@ 2023-05-10 14:16 Markus Armbruster
2023-05-10 14:40 ` Juan Quintela
0 siblings, 1 reply; 2+ messages in thread
From: Markus Armbruster @ 2023-05-10 14:16 UTC (permalink / raw)
To: qemu-devel; +Cc: michael.roth, jsnow, quintela
The error message is bad when the section is untagged. For instance,
test case doc-interleaved-section produces "'@foobar:' can't follow
'Note' section", which is okay, but if we drop the "Note:" tag, we get
"'@foobar:' can't follow 'None' section, which is bad.
Change the error message to "description of '@foobar:' follows a
section".
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
scripts/qapi/parser.py | 4 ++--
tests/qapi-schema/doc-interleaved-section.err | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 878f90b458..3de467493f 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -700,8 +700,8 @@ def _append_various_line(self, line: str) -> None:
if name.startswith('@') and name.endswith(':'):
raise QAPIParseError(self._parser,
- "'%s' can't follow '%s' section"
- % (name, self.sections[0].name))
+ "description of '%s' follows a section"
+ % name)
if self._is_section_tag(name):
# If line is "Section: first line of description", find
# the index of 'f', which is the indent we expect for any
diff --git a/tests/qapi-schema/doc-interleaved-section.err b/tests/qapi-schema/doc-interleaved-section.err
index 715d58cd31..e5d1ef54c1 100644
--- a/tests/qapi-schema/doc-interleaved-section.err
+++ b/tests/qapi-schema/doc-interleaved-section.err
@@ -1 +1 @@
-doc-interleaved-section.json:15:1: '@foobar:' can't follow 'Note' section
+doc-interleaved-section.json:15:1: description of '@foobar:' follows a section
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] qapi: Improve error message for description following section
2023-05-10 14:16 [PATCH] qapi: Improve error message for description following section Markus Armbruster
@ 2023-05-10 14:40 ` Juan Quintela
0 siblings, 0 replies; 2+ messages in thread
From: Juan Quintela @ 2023-05-10 14:40 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel, michael.roth, jsnow
Markus Armbruster <armbru@redhat.com> wrote:
> The error message is bad when the section is untagged. For instance,
> test case doc-interleaved-section produces "'@foobar:' can't follow
> 'Note' section", which is okay, but if we drop the "Note:" tag, we get
> "'@foobar:' can't follow 'None' section, which is bad.
>
> Change the error message to "description of '@foobar:' follows a
> section".
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-10 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-10 14:16 [PATCH] qapi: Improve error message for description following section Markus Armbruster
2023-05-10 14:40 ` Juan Quintela
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.