]> git.ipfire.org Git - thirdparty/qemu.git/commit
docs/qapidoc: support header-less freeform sections
authorJohn Snow <jsnow@redhat.com>
Mon, 24 Feb 2025 03:37:35 +0000 (22:37 -0500)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 4 Mar 2025 06:11:06 +0000 (07:11 +0100)
commitb61a4eb3f32ce74c5ffe001806f9e786788a546f
treeca2988c9b713ce4f16954eec7b7863da4d049d65
parent6a2c7fc29ab6e8fdce4829d3229db534abf923bb
docs/qapidoc: support header-less freeform sections

The code as written crashes when a free-form documentation block doesn't
start with a heading or subheading, for example:

| ##
| # Just text, no heading.
| ##

The code will attempt to use the `node` variable uninitialized. To fix,
create a generic block to insert the doc text into.

(This patch also removes a lingering pylint warning in the QAPIDoc
implementation that prevents getting a clean baseline to use for
forthcoming additions.)

Fixes: 43e0d14ee09a (docs/sphinx: fix extra stuff in TOC after freeform QMP sections)
Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20250224033741.222749-5-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Test updated to cover this]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
docs/sphinx/qapidoc.py
tests/qapi-schema/doc-good.json
tests/qapi-schema/doc-good.out