[PATCH 20/20] qapi: convert "Example" sections to rST

2024-05-14 Thread John Snow
t annotations into captions manually. (Tedious, oh well.) 3. Add captions where still needed: sed -zi 's|# .. code-block:: QMP\n#\n|# .. code-block:: QMP\n#:caption: Example\n#\n|g' *.json Not fully ideal, but hopefully not something that has to be

[PATCH 12/20] qapi/source: allow multi-line QAPISourceInfo advancing

2024-05-14 Thread John Snow
This is for the sake of the new rST generator (the "transmogrifier") so we can advance multiple lines on occasion while keeping the generated<-->source mappings accurate. next_line now simply takes an optional n parameter which chooses the number of lines to advance. Signed-o

[PATCH 08/20] qapi/parser: differentiate intro and outro paragraphs

2024-05-14 Thread John Snow
Add a semantic tag to paragraphs that appear *before* tagged sections/members/features and those that appear after. This will control how they are inlined when doc sections are merged and flattened. Signed-off-by: John Snow --- scripts/qapi/parser.py | 22 +- 1 file changed

[PATCH 05/20] qapi/parser: adjust info location for doc body section

2024-05-14 Thread John Snow
Instead of using the info object for the doc block as a whole, update the info pointer for each call to ensure_untagged_section when the existing section is otherwise empty. This way, Sphinx error information will match precisely to where the text actually starts. Signed-off-by: John Snow

[PATCH 04/20] qapi/parser: preserve indentation in QAPIDoc sections

2024-05-14 Thread John Snow
for rST.) Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 36 +- scripts/qapi/parser.py | 8 ++-- tests/qapi-schema/doc-good.out | 32 +++--- 3 files changed, 53 insertions(+), 23 deletions(-) diff --git a/docs/sphinx

[PATCH 16/20] qapi: rewrite StatsFilter comment

2024-05-14 Thread John Snow
Rewrite the StatsFilter intro paragraph to be more meaningful to end-users when it is inlined in generated documentation. Signed-off-by: John Snow --- qapi/stats.json | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qapi/stats.json b/qapi/stats.json index 578b52c7ef7

[PATCH 09/20] qapi/parser: add undocumented stub members to all_sections

2024-05-14 Thread John Snow
This helps simplify the doc generator if it doesn't have to check for undocumented members. Signed-off-by: John Snow --- scripts/qapi/parser.py | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py

[PATCH 10/20] qapi/schema: add __iter__ method to QAPISchemaVariants

2024-05-14 Thread John Snow
iants else []: ... against: for var in variants or []: ... Update callsites to reflect the new usage pattern. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 2 +- scripts/qapi/introspect.py | 4 ++-- scripts/qapi/schema.py | 8 ++-- scripts/qapi/types.py

[PATCH 13/20] docs/qapidoc: fix nested parsing under untagged sections

2024-05-14 Thread John Snow
parsing an untagged section (free paragraphs), skip making a hollow section and instead append the parse results to the prior section. Many Bothans died to bring us this information. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 16 +++- 1 file changed, 11 insertions(+), 5

[PATCH 15/20] qapi: remove developer factoring comments from QAPI doc blocks

2024-05-14 Thread John Snow
ttle to no use to *either* audience, and convert what's left to garden-variety comments to prevent it from showing up in rendered documentation. Signed-off-by: John Snow --- qapi/audio.json| 5 ++--- qapi/block-core.json | 47 ++ qapi/block-ex

[PATCH 19/20] qapi: convert "Note" sections to plain rST

2024-05-14 Thread John Snow
: .. Note:: ... .. admonition:: custom title admonition body text This patch uses ".. notes::" almost everywhere, with just two "caution" directives. ".. admonition:: notes" is used in a few places where we had an ordered list of multiple notes. Signed-off-

[PATCH 03/20] docs/qapidoc: delint a tiny portion of the module

2024-05-14 Thread John Snow
ot;pip install black" (without root permissions) if you do not have it installed otherwise. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index f270b494f

[PATCH 14/20] qapi: fix non-compliant JSON examples

2024-05-14 Thread John Snow
t;, so two examples have been adjusted to support that format here. Signed-off-by: John Snow --- qapi/control.json | 3 ++- qapi/machine.json | 2 +- qapi/migration.json | 2 +- qapi/misc.json | 3 ++- qapi/net.json | 6 +++--- qapi/rocker.json| 2 +- qapi/ui.json| 2 +

[PATCH 06/20] qapi/parser: fix comment parsing immediately following a doc block

2024-05-14 Thread John Snow
If a comment immediately follows a doc block, the parser doesn't ignore that token appropriately. Fix that. Signed-off-by: John Snow --- scripts/qapi/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 41b931

[PATCH 01/20] [DO-NOT-MERGE]: Add some ad-hoc linting helpers.

2024-05-14 Thread John Snow
after this series. Sorry about that! Signed-off-by: John Snow --- scripts/qapi-lint.sh | 51 +++ scripts/qapi/Makefile | 5 + 2 files changed, 56 insertions(+) create mode 100755 scripts/qapi-lint.sh create mode 100644 scripts/qapi/Makefile diff

[PATCH 17/20] qapi: rewrite BlockExportOptions doc block

2024-05-14 Thread John Snow
Rephrase this paragraph so that it can apply to any commands that inherit from this object. Signed-off-by: John Snow --- qapi/block-export.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qapi/block-export.json b/qapi/block-export.json index dc328097a94

[PATCH 18/20] qapi: ensure all errors sections are uniformly typset

2024-05-14 Thread John Snow
Transactions have the only instance of an Errors section that isn't a rST list; turn it into one. Signed-off-by: John Snow --- qapi/transaction.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/transaction.json b/qapi/transaction.json index 5749c133d4a..07afc2

[PATCH 07/20] qapi/parser: add semantic 'kind' parameter to QAPIDoc.Section

2024-05-14 Thread John Snow
ll_sections, we need *something* accessible to distinguish them. To keep types simple, add this semantic parameter to the base Section and not just ArgSection; we can use this to filter out paragraphs and tagged sections, too. Signed-off-by: John Snow --- scripts/qapi/parser.py | 25 +

Re: [PATCH 03/20] docs/qapidoc: delint a tiny portion of the module

2024-05-15 Thread John Snow
On Wed, May 15, 2024, 5:17 AM Markus Armbruster wrote: > John Snow writes: > > > In the coming patches, it's helpful to have a linting baseline. However, > > there's no need to shuffle around the deck chairs too much, because most > > of this code will be remo

Re: [PATCH 04/20] qapi/parser: preserve indentation in QAPIDoc sections

2024-05-15 Thread John Snow
On Wed, May 15, 2024, 7:50 AM Markus Armbruster wrote: > John Snow writes: > > > Prior to this patch, a section like this: > > > > @name: lorem ipsum > >dolor sit amet > > consectetur adipiscing elit > > > > would be parsed as: >

Re: [PATCH 03/20] docs/qapidoc: delint a tiny portion of the module

2024-05-15 Thread John Snow
On Wed, May 15, 2024 at 5:17 AM Markus Armbruster wrote: > John Snow writes: > > > In the coming patches, it's helpful to have a linting baseline. However, > > there's no need to shuffle around the deck chairs too much, because most > > of this code wi

Re: [PATCH 04/20] qapi/parser: preserve indentation in QAPIDoc sections

2024-05-15 Thread John Snow
On Wed, May 15, 2024 at 10:18 AM Markus Armbruster wrote: > John Snow writes: > > > On Wed, May 15, 2024, 7:50 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > Prior to this patch, a section like this: > &

Re: [PATCH 03/20] docs/qapidoc: delint a tiny portion of the module

2024-05-15 Thread John Snow
On Wed, May 15, 2024, 1:27 PM Markus Armbruster wrote: > John Snow writes: > > > On Wed, May 15, 2024 at 5:17 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > In the coming patches, it's helpful to have a lintin

Re: [PATCH 05/20] qapi/parser: adjust info location for doc body section

2024-05-16 Thread John Snow
On Thu, May 16, 2024, 1:58 AM Markus Armbruster wrote: > John Snow writes: > > > Instead of using the info object for the doc block as a whole, update > > the info pointer for each call to ensure_untagged_section when the > > existing section is otherwise empty

Re: [PATCH 07/20] qapi/parser: add semantic 'kind' parameter to QAPIDoc.Section

2024-05-16 Thread John Snow
On Thu, May 16, 2024, 2:18 AM Markus Armbruster wrote: > John Snow writes: > > > When iterating all_sections, this is helpful to be able to distinguish > > "members" from "features"; the only other way to do so is to > > cross-reference these secti

Re: [PATCH 08/20] qapi/parser: differentiate intro and outro paragraphs

2024-05-16 Thread John Snow
On Thu, May 16, 2024, 5:34 AM Markus Armbruster wrote: > John Snow writes: > > > Add a semantic tag to paragraphs that appear *before* tagged > > sections/members/features and those that appear after. This will control > > how they are inlined when doc sections

Re: [PATCH 06/20] qapi/parser: fix comment parsing immediately following a doc block

2024-05-16 Thread John Snow
On Thu, May 16, 2024 at 2:01 AM Markus Armbruster wrote: > John Snow writes: > > > If a comment immediately follows a doc block, the parser doesn't ignore > > that token appropriately. Fix that. > > Reproducer? > > > > > Signed-off-by: John S

Re: [PATCH 08/20] qapi/parser: differentiate intro and outro paragraphs

2024-05-16 Thread John Snow
On Thu, May 16, 2024 at 11:06 AM John Snow wrote: > > > On Thu, May 16, 2024, 5:34 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > Add a semantic tag to paragraphs that appear *before* tagged >> > sections/members/features and those that app

Re: [PATCH 06/20] qapi/parser: fix comment parsing immediately following a doc block

2024-06-17 Thread John Snow
On Thu, Jun 13, 2024 at 10:32 AM Markus Armbruster wrote: > John Snow writes: > > > On Thu, May 16, 2024 at 2:01 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > If a comment immediately follows a doc block, the parser do

Re: [PATCH 07/20] qapi/parser: add semantic 'kind' parameter to QAPIDoc.Section

2024-06-17 Thread John Snow
On Thu, Jun 13, 2024 at 10:46 AM Markus Armbruster wrote: > John Snow writes: > > > On Thu, May 16, 2024, 2:18 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > When iterating all_sections, this is helpful to be able to dis

Re: [PATCH 09/20] qapi/parser: add undocumented stub members to all_sections

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024 at 4:53 AM Markus Armbruster wrote: > John Snow writes: > > > This helps simplify the doc generator if it doesn't have to check for > > undocumented members. > > > > Signed-off-by: John Snow > > --- > > scripts/qapi/parser.p

Re: [PATCH 11/20] qapi/schema: add doc_visible property to QAPISchemaDefinition

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 5:40 AM Markus Armbruster wrote: > John Snow writes: > > > The intent here is to mark only certain definitions as visible in the > > end-user docs. > > > > All commands and events are inherently visible. Everything else is > > visible

Re: [PATCH 13/20] docs/qapidoc: fix nested parsing under untagged sections

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 5:46 AM Markus Armbruster wrote: > John Snow writes: > > > Sphinx does not like sections without titles, because it wants to > > convert every section into a reference. When there is no title, it > > struggles to do this and transf

Re: [PATCH 14/20] qapi: fix non-compliant JSON examples

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 6:55 AM Markus Armbruster wrote: > John Snow writes: > > > If we parse all examples as QMP, we need them to conform to a standard > > so that they render correctly. Once the QMP lexer is active for > > examples, these will produce warning mes

Re: [PATCH 18/20] qapi: ensure all errors sections are uniformly typset

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 7:24 AM Markus Armbruster wrote: > John Snow writes: > > > Transactions have the only instance of an Errors section that isn't a > > rST list; turn it into one. > > Just for consistency? Or do you have other shenanigans up your sleeve? >

Re: [PATCH 19/20] qapi: convert "Note" sections to plain rST

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 9:44 AM Markus Armbruster wrote: > John Snow writes: > > > We do not need a dedicated section for notes. By eliminating a specially > > parsed section, these notes can be treated as normal rST paragraphs in > > the new QMP reference manual, and

Re: [PATCH 20/20] qapi: convert "Example" sections to rST

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024 at 10:39 AM Markus Armbruster wrote: > John Snow writes: > > > Eliminate the "Example" sections in QAPI doc blocks, converting them > > into QMP example code blocks. This is generally done by converting > > "Example:" or "

[PATCH 00/13] qapi: convert "Note" and "Example" sections to rST

2024-06-18 Thread John Snow
les is a little ugly in rendered HTML output; My CSS intern wasn't available before publication time to fix it ;) -- Will fix with an amendment patch at next opportunity. Any feedback not implemented should be interpreted as evidence of a forgetful (rather than a spiteful) mind. Please re

[PATCH 02/13] qapi: linter fixups

2024-06-18 Thread John Snow
Fix minor irritants to pylint/flake8 et al. (Yes, these need to be guarded by the Python tests. That's a work in progress, a series that's quite likely to follow once I finish this Sphinx project. Please pardon the temporary irritation.) Signed-off-by: John Snow Reviewed-by: Markus

[PATCH 06/13] docs/qapidoc: fix nested parsing under untagged sections

2024-06-18 Thread John Snow
tion (free paragraphs), skip making a hollow section and instead append the parse results to the prior section. Many Bothans died to bring us this information. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/d

[PATCH 05/13] qapi/parser: fix comment parsing immediately following a doc block

2024-06-18 Thread John Snow
llows a doc block. Fixes: 3d035cd2cca6 (qapi: Rewrite doc comment parser) Signed-off-by: John Snow --- scripts/qapi/parser.py | 2 +- tests/qapi-schema/doc-good.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 43167e

[PATCH 03/13] docs/qapidoc: delint a tiny portion of the module

2024-06-18 Thread John Snow
am. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 66 +- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index f270b494f01..e675966defa 100644 --- a/docs/sphinx/qapidoc.py +++ b/docs/sp

[PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-18 Thread John Snow
here, with just two "caution" directives. ".. admonition:: notes" is used in a few places where we had an ordered list of multiple notes that would not make sense as standalone/separate admonitions. Signed-off-by: John Snow Acked-by: Stefan Hajnoczi [for block*.json] ---

[PATCH 07/13] qapi: fix non-compliant JSON examples

2024-06-18 Thread John Snow
een adjusted to support that format here. Signed-off-by: John Snow --- qapi/control.json | 3 ++- qapi/machine.json | 2 +- qapi/migration.json | 2 +- qapi/misc.json | 3 ++- qapi/net.json | 6 +++--- qapi/rocker.json| 2 +- qapi/ui.json| 2 +- 7 files changed, 11 inserti

[PATCH 08/13] qapi: ensure all errors sections are uniformly typset

2024-06-18 Thread John Snow
Transactions have the only instance of an Errors section that isn't a rST list; turn it into one. Signed-off-by: John Snow --- docs/devel/qapi-code-gen.rst | 7 +++ qapi/transaction.json| 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/devel/qapi

[PATCH 01/13] [DO-NOT-MERGE]: Add some ad-hoc linting helpers.

2024-06-18 Thread John Snow
after this series. Sorry about that! Signed-off-by: John Snow --- scripts/qapi-lint.sh | 59 +++ scripts/qapi/Makefile | 5 2 files changed, 64 insertions(+) create mode 100755 scripts/qapi-lint.sh create mode 100644 scripts/qapi/Makefile diff

[PATCH 11/13] qapi: add markup to note blocks

2024-06-18 Thread John Snow
masse in a subsequent patch after the new QAPI doc generator is merged. Signed-off-by: John Snow --- qapi/control.json | 4 ++-- qapi/misc.json | 8 qapi/qdev.json | 2 +- qapi/run-state.json | 2 +- qapi/sockets.json | 2 +- qapi/ui.json| 2 +- 6 files changed, 10

[PATCH 10/13] qapi: update prose in note blocks

2024-06-18 Thread John Snow
Where I've noticed, rephrase the note to read more fluently. Signed-off-by: John Snow --- qapi/block-core.json | 4 ++-- qga/qapi-schema.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index cacedfb771c..9ef23ec02ae 1

[PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections

2024-06-18 Thread John Snow
anual/interop/qemu-storage-daemon-qmp-ref.html Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 29 - scripts/qapi/parser.py | 5 +++-- tests/qapi-schema/doc-good.out | 32 3 files changed, 43 insertions(+), 23 dele

[PATCH 12/13] qapi/parser: don't parse rST markup as section headers

2024-06-18 Thread John Snow
The double-colon synax is rST formatting that precedes a literal code block. We do not want to capture these as QAPI-specific sections. Coerce blocks that start with e.g. "Example::" to be parsed as untagged paragraphs instead of special tagged sections. Signed-off-by: John Snow --

[PATCH 13/13] qapi: convert "Example" sections to rST

2024-06-18 Thread John Snow
ons that no longer parse successfully by attempting the doc build, convert annotations into captions manually. (Tedious, oh well.) 3. Add captions where still needed: sed -zi 's|# .. code-block:: QMP\n#\n|# .. code-block:: QMP\n#:caption: Example\n#\n|g' *.json Not fully ideal, but

Re: [PATCH 03/13] docs/qapidoc: delint a tiny portion of the module

2024-06-19 Thread John Snow
On Wed, Jun 19, 2024, 2:28 AM Markus Armbruster wrote: > John Snow writes: > > > In a forthcoming series that adds a new QMP documentation generator, it > > will be helpful to have a linting baseline. However, there's no need to > > shuffle around the deck chairs t

Re: [PATCH 13/13] qapi: convert "Example" sections to rST

2024-06-19 Thread John Snow
On Wed, Jun 19, 2024, 9:20 AM Markus Armbruster wrote: > John Snow writes: > > > Eliminate the "Example" sections in QAPI doc blocks, converting them > > into QMP example code blocks. This is generally done in this patch by > > converting "Example:&qu

Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections

2024-06-20 Thread John Snow
On Wed, Jun 19, 2024, 8:03 AM Markus Armbruster wrote: > John Snow writes: > > > Change get_doc_indented() to preserve indentation on all subsequent text > > lines, and create a compatibility dedent() function for qapidoc.py to > > remove that indentation. This is being

Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections

2024-06-20 Thread John Snow
On Thu, Jun 20, 2024, 11:07 AM Markus Armbruster wrote: > John Snow writes: > > > On Wed, Jun 19, 2024, 8:03 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > Change get_doc_indented() to preserve indentation on all subsequ

Re: [PATCH 08/13] qapi: ensure all errors sections are uniformly typset

2024-06-20 Thread John Snow
On Wed, Jun 19, 2024, 8:10 AM Markus Armbruster wrote: > John Snow writes: > > > Transactions have the only instance of an Errors section that isn't a > > rST list; turn it into one. > > > > Signed-off-by: John Snow > > Let;s explain the "why"

Re: [PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-20 Thread John Snow
On Wed, Jun 19, 2024, 8:49 AM Markus Armbruster wrote: > John Snow writes: > > > We do not need a dedicated section for notes. By eliminating a specially > > parsed section, these notes can be treated as normal rST paragraphs in > > the new QMP reference manual, and

Re: [PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-20 Thread John Snow
On Wed, Jun 19, 2024, 9:07 AM Markus Armbruster wrote: > John Snow writes: > > > We do not need a dedicated section for notes. By eliminating a specially > > parsed section, these notes can be treated as normal rST paragraphs in > > the new QMP reference manual, and

Re: [PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-20 Thread John Snow
On Thu, Jun 20, 2024, 9:35 AM Markus Armbruster wrote: > Markus Armbruster writes: > > > John Snow writes: > > [...] > > >> diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json > >> index b3de1fb6b3a..57598331c5c 100644 > >> --- a/qga/

Re: [PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-20 Thread John Snow
On Thu, Jun 20, 2024, 9:55 AM Markus Armbruster wrote: > John Snow writes: > > > We do not need a dedicated section for notes. By eliminating a specially > > parsed section, these notes can be treated as normal rST paragraphs in > > the new QMP reference manual, and

Re: [PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-20 Thread John Snow
On Thu, Jun 20, 2024 at 11:46 AM John Snow wrote: > > > On Thu, Jun 20, 2024, 9:35 AM Markus Armbruster wrote: > >> Markus Armbruster writes: >> >> > John Snow writes: >> >> [...] >> >> >> diff --git a/qga/qapi-schema.json b/q

Re: [PATCH 04/13] qapi/parser: preserve indentation in QAPIDoc sections

2024-06-21 Thread John Snow
On Fri, Jun 21, 2024 at 2:38 AM Markus Armbruster wrote: > John Snow writes: > > > On Thu, Jun 20, 2024, 11:07 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > On Wed, Jun 19, 2024, 8:03 AM Markus Ar

Re: [PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-21 Thread John Snow
On Fri, Jun 21, 2024 at 8:08 AM Markus Armbruster wrote: > John Snow writes: > > > We do not need a dedicated section for notes. By eliminating a specially > > parsed section, these notes can be treated as normal rST paragraphs in > > the new QMP reference manual, and

Re: [PATCH 09/13] qapi: convert "Note" sections to plain rST

2024-06-21 Thread John Snow
On Fri, Jun 21, 2024 at 8:23 AM Markus Armbruster wrote: > John Snow writes: > > > On Thu, Jun 20, 2024 at 11:46 AM John Snow wrote: > > > >> > >> > >> On Thu, Jun 20, 2024, 9:35 AM Markus Armbruster > wrote: > >> > &g

Re: [PATCH 05/20] qapi/parser: adjust info location for doc body section

2024-06-21 Thread John Snow
On Mon, May 27, 2024 at 7:58 AM Markus Armbruster wrote: > John Snow writes: > > > On Thu, May 16, 2024, 1:58 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > Instead of using the info object for the doc block as a who

Re: [PATCH 13/13] qapi: convert "Example" sections to rST

2024-06-26 Thread John Snow
On Wed, Jun 26, 2024, 1:18 AM Markus Armbruster wrote: > John Snow writes: > > > Eliminate the "Example" sections in QAPI doc blocks, converting them > > into QMP example code blocks. This is generally done in this patch by > > converting "Example:&qu

[PATCH v2 00/21] qapi: convert "Note" and "Example" sections to rST

2024-06-26 Thread John Snow
ox styling and sphinx directive macro - Addressed... most? list feedback. (But not the indent split.) Known issues: - The Example boxes are styled a little wonkily if prose follows the code-block instead of precedes it, fixup will be tomorrow. --js Harmonie Snow (1): docs/sphinx: add CSS stylin

[PATCH v2 03/21] docs/qapidoc: remove unused intersperse function

2024-06-26 Thread John Snow
This function has been unused since fd62bff901b. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 10 -- 1 file changed, 10 deletions(-) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index f270b494f01..3c0565d0ceb 100644 --- a/docs/sphinx/qapidoc.py +++ b/docs

[PATCH v2 05/21] qapi/parser: preserve indentation in QAPIDoc sections

2024-06-26 Thread John Snow
will not be needed any longer and can be dropped. Signed-off-by: John Snow [Edited commit message and code comments per review --js] Reviewed-by: Markus Armbruster --- docs/sphinx/qapidoc.py | 27 ++- scripts/qapi/parser.py | 4 ++-- tests/qapi-schema/doc

[PATCH v2 09/21] qapi: nail down convention that Errors sections are lists

2024-06-26 Thread John Snow
By unstated convention, Errors sections are rST lists. Document the convention, and make the one exception conform. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- docs/devel/qapi-code-gen.rst | 7 +++ qapi/transaction.json| 2 +- 2 files changed, 8 insertions(+), 1

[PATCH v2 08/21] qapi: fix non-compliant JSON examples

2024-06-26 Thread John Snow
examples have been adjusted to support that format here. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- qapi/control.json | 3 ++- qapi/machine.json | 2 +- qapi/migration.json | 2 +- qapi/misc.json | 3 ++- qapi/net.json | 6 +++--- qapi/rocker.json| 2 +- qapi/ui.

[PATCH v2 06/21] qapi/parser: fix comment parsing immediately following a doc block

2024-06-26 Thread John Snow
llows a doc block. Fixes: 3d035cd2cca6 (qapi: Rewrite doc comment parser) Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/parser.py | 2 +- tests/qapi-schema/doc-good.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/parser.py b/scr

[PATCH v2 11/21] qapi: update prose in note blocks

2024-06-26 Thread John Snow
Where I've noticed, rephrase the note to read more fluently. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- qapi/block-core.json | 4 ++-- qga/qapi-schema.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json

[PATCH v2 04/21] docs/qapidoc: delint a tiny portion of the module

2024-06-26 Thread John Snow
am. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- docs/sphinx/qapidoc.py | 62 +- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index 3c0565d0ceb..659e507353a 100644 --

[PATCH v2 19/21] qapi: convert "Example" sections with titles

2024-06-26 Thread John Snow
ve syntax. See commit+2: "qapi: remove "Example" doc section" for a detailed explanation of why. Signed-off-by: John Snow --- qapi/block-core.json | 24 qapi/block.json | 13 ++--- qapi/migration.json | 25 ++---

[PATCH v2 12/21] qapi: add markup to note blocks

2024-06-26 Thread John Snow
masse in a subsequent patch after the new QAPI doc generator is merged. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- qapi/control.json | 4 ++-- qapi/misc.json | 8 qapi/qdev.json | 2 +- qapi/run-state.json | 2 +- qapi/sockets.json | 2 +- qapi/ui.json

[PATCH v2 01/21] [DO-NOT-MERGE]: Add some ad-hoc linting helpers.

2024-06-26 Thread John Snow
after this series. Sorry about that! Signed-off-by: John Snow --- scripts/qapi-lint.sh | 61 +++ scripts/qapi/Makefile | 5 2 files changed, 66 insertions(+) create mode 100755 scripts/qapi-lint.sh create mode 100644 scripts/qapi/Makefile diff

[PATCH v2 17/21] docs/sphinx: add CSS styling for qmp-example directive

2024-06-26 Thread John Snow
From: Harmonie Snow Add CSS styling for qmp-example directives to increase readability and consistently style all example blocks. Signed-off-by: Harmonie Snow Signed-off-by: John Snow --- docs/sphinx-static/theme_overrides.css | 46 ++ 1 file changed, 46 insertions

[PATCH v2 16/21] docs/qapidoc: add QMP highlighting to annotated qmp-example blocks

2024-06-26 Thread John Snow
; } ``` But instead, simply: ``` .. qmp-example:: :annotated: Blah blah:: -> { "lorem": "ipsum" } ``` Once the directive block is exited, whatever the previous default highlight language was will be restored; localizing the forced QMP lexing to exclusively this dir

[PATCH v2 14/21] docs/qapidoc: factor out do_parse()

2024-06-26 Thread John Snow
Factor out the compatibility parser helper so it can be shared by other directives. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 64 +++--- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx

[PATCH v2 13/21] qapi/parser: don't parse rST markup as section headers

2024-06-26 Thread John Snow
The double-colon synax is rST formatting that precedes a literal code block. We do not want to capture these as QAPI-specific sections. Coerce blocks that start with e.g. "Example::" to be parsed as untagged paragraphs instead of special tagged sections. Signed-off-by: John Snow --

[PATCH v2 18/21] qapi: convert "Example" sections without titles

2024-06-26 Thread John Snow
mit+3: "qapi: remove "Example" doc section" for a detailed explanation of why. Signed-off-by: John Snow --- qapi/acpi.json | 4 +-- qapi/block-core.json | 64 +--- qapi/block.json | 18 ++

[PATCH v2 10/21] qapi: convert "Note" sections to plain rST

2024-06-26 Thread John Snow
gged section" to an "untagged section" means that rendering order for some notes *may change* as a result of this patch. The forthcoming qapidoc.py rewrite strictly preserves source ordering in the rendered documentation, so this issue will be rectified in the new generator. Sign

[PATCH v2 02/21] qapi: linter fixups

2024-06-26 Thread John Snow
Fix minor irritants to pylint/flake8 et al. (Yes, these need to be guarded by the Python tests. That's a work in progress, a series that's quite likely to follow once I finish this Sphinx project. Please pardon the temporary irritation.) Signed-off-by: John Snow Reviewed-by: Markus

[PATCH v2 20/21] qapi: convert "Example" sections with longer prose

2024-06-26 Thread John Snow
that was better to convert all at once. See commit-5: "docs/qapidoc: create qmp-example directive", for a detailed explanation of this custom directive syntax. See commit+1: "qapi: remove "Example" doc section" for a detailed explanation of w

[PATCH v2 07/21] docs/qapidoc: fix nested parsing under untagged sections

2024-06-26 Thread John Snow
tion (free paragraphs), skip making a hollow section and instead append the parse results to the prior section. Many Bothans died to bring us this information. Signed-off-by: John Snow Acked-by: Markus Armbruster --- docs/sphinx/qapidoc.py | 16 +++- 1 file changed, 11 insertions(+), 5

[PATCH v2 21/21] qapi: remove "Example" doc section

2024-06-26 Thread John Snow
lly valid examples.) NOTE: As with the "Notes" conversion patch, this patch (and those preceding) may change the rendering order for Examples in the current generator. The forthcoming qapidoc rewrite will fix this by always generating documentation in source order. Signe

[PATCH v2 15/21] docs/qapidoc: create qmp-example directive

2024-06-26 Thread John Snow
his commit, the code-block rST syntax "::" does not apply QMP highlighting; you would need to use ".. code-block:: QMP". The very next commit changes this behavior to assume all "::" code blocks within this directive are QMP blocks. Signed-off-by: Joh

[PATCH 3/4] iotests: Change imports for Python 3.13

2024-06-26 Thread John Snow
Python 3.13 isn't out yet, but it's in beta and Fedora is ramping up to make it the default system interpreter for Fedora 41. They moved our cheese for where ContextManager lives; add a conditional to locate it while we support both pre-3.9 and 3.13+. Signed-off-by: John Snow ---

[PATCH 4/4] python: enable testing for 3.13

2024-06-26 Thread John Snow
Python 3.13 is in beta and Fedora 41 is preparing to make it the default system interpreter; enable testing for it. (In the event problems develop prior to release, it should only impact the check-python-tox job, which is not run by default and is allowed to fail.) Signed-off-by: John Snow

[PATCH 2/4] python: Do not use pylint 3.2.4 with python 3.8

2024-06-26 Thread John Snow
There is a bug in this version, see: https://github.com/pylint-dev/pylint/issues/9751 Signed-off-by: John Snow --- python/setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/python/setup.cfg b/python/setup.cfg index 48668609d3e..8ebd345d7ed 100644 --- a/python/setup.cfg +++ b/python

[PATCH 1/4] python: linter changes for pylint 3.x

2024-06-26 Thread John Snow
ng variable 'sock' before assignment (possibly-used-before-assignment) qemu/utils/qemu_ga_client.py:168:4: R1711: Useless return at end of function or method (useless-return) Signed-off-by: John Snow --- python/qemu/machine/machine.py | 1 + python/qemu/utils/qemu_ga_client.py | 2 +-

[PATCH 0/4] Python: Add 3.13 support, play linter whackamole

2024-06-26 Thread John Snow
jsnow/qemu/-/pipelines/1349737188 John Snow (4): python: linter changes for pylint 3.x python: Do not use pylint 3.2.4 with python 3.8 iotests: Change imports for Python 3.13 python: enable testing for 3.13 python/qemu/machine/machine.py | 1 + python/qemu/utils/qemu_ga_client

Re: [PATCH v2 03/21] docs/qapidoc: remove unused intersperse function

2024-06-26 Thread John Snow
On Thu, Jun 27, 2024, 2:02 AM Markus Armbruster wrote: > John Snow writes: > > > This function has been unused since fd62bff901b. > > > > Signed-off-by: John Snow > > Reviewed-by: Markus Armbruster > > I assume you won't mind me adding a bit of po

Re: [PATCH v2 05/21] qapi/parser: preserve indentation in QAPIDoc sections

2024-06-26 Thread John Snow
On Thu, Jun 27, 2024, 2:25 AM Markus Armbruster wrote: > John Snow writes: > > > Change get_doc_indented() to preserve indentation on all subsequent text > > lines, and create a compatibility dedent() function for qapidoc.py that > > removes indentation the same wa

Re: [PATCH v2 04/21] docs/qapidoc: delint a tiny portion of the module

2024-06-28 Thread John Snow
On Fri, Jun 28, 2024, 3:29 AM Markus Armbruster wrote: > John Snow writes: > > > In a forthcoming series that adds a new QMP documentation generator, it > > will be helpful to have a linting baseline. However, there's no need to > > shuffle around the deck chairs t

Re: [PATCH v2 07/21] docs/qapidoc: fix nested parsing under untagged sections

2024-06-28 Thread John Snow
On Fri, Jun 28, 2024, 3:55 AM Markus Armbruster wrote: > John Snow writes: > > > Sphinx does not like sections without titles, because it wants to > > convert every section into a reference. When there is no title, it > > struggles to do this and transf

Re: [PATCH v2 14/21] docs/qapidoc: factor out do_parse()

2024-06-28 Thread John Snow
On Fri, Jun 28, 2024, 9:09 AM Markus Armbruster wrote: > John Snow writes: > > > Factor out the compatibility parser helper so it can be shared by other > > directives. > > Suggest "Factor out the compatibility parser helper into a base class, > so it can be sha

Re: [PATCH v2 15/21] docs/qapidoc: create qmp-example directive

2024-06-28 Thread John Snow
On Fri, Jun 28, 2024, 9:24 AM Markus Armbruster wrote: > John Snow writes: > > > This is a directive that creates a syntactic sugar for creating > > "Example" boxes very similar to the ones already used in the bitmaps.rst > > document, please see e.g. >

Re: [PATCH v2 07/21] docs/qapidoc: fix nested parsing under untagged sections

2024-06-28 Thread John Snow
On Fri, Jun 28, 2024, 11:10 AM John Snow wrote: > > > On Fri, Jun 28, 2024, 3:55 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > Sphinx does not like sections without titles, because it wants to >> > convert every section into a reference.

  1   2   3   4   5   6   7   8   9   10   >