All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael Roth" <michael.roth@amd.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Kashyap Chamarthy" <kchamart@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Kostiantyn Kostiuk" <kkostiuk@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	qemu-block@nongnu.org, qemu-trivial@nongnu.org,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Eric Blake" <eblake@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>
Subject: Re: [PATCH 2/9] qapi: convert intro sections for unit tests
Date: Wed, 23 Sep 2026 08:35:13 +0200	[thread overview]
Message-ID: <878q4szd9a.fsf@pond.sub.org> (raw)
In-Reply-To: <CAFn=p-Z1gTHSk1=G_eU=MRCT93j7kpcnub=O2o1vXL95kD9B=g@mail.gmail.com> (John Snow's message of "Tue, 22 Sep 2026 13:29:12 -0400")

John Snow <jsnow@redhat.com> writes:

> On Tue, Sep 22, 2026 at 1:06 PM Markus Armbruster <armbru@redhat.com> wrote:
>>
>> John Snow <jsnow@redhat.com> writes:
>>
>> > Signed-off-by: John Snow <jsnow@redhat.com>
>> > ---
>> >  tests/qapi-schema/doc-good.json                | 10 +++++-----
>> >  tests/qapi-schema/doc-good.out                 | 13 +++++--------
>> >  tests/qapi-schema/doc-interleaved-section.err  |  2 +-
>> >  tests/qapi-schema/doc-interleaved-section.json |  3 +--
>> >  4 files changed, 12 insertions(+), 16 deletions(-)
>> >
>> > diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json
>> > index fac13425b72..00721d5c522 100644
>> > --- a/tests/qapi-schema/doc-good.json
>> > +++ b/tests/qapi-schema/doc-good.json
>> > @@ -94,12 +94,11 @@
>> >
>> >  ##
>> >  # @Variant1:
>> > +#     A paragraph
>> >  #
>> > -# A paragraph
>> > +#     Another paragraph
>> >  #
>> > -# Another paragraph
>> > -#
>> > -# @var1 is undocumented
>> > +#     @var1 is undocumented
>>
>> Let's keep '@var1 is undocumented' plain.  That way, it stays close to
>> "author forgot the colon after the member name", which I find useful.
>
> OK, but it will very soon be disallowed in that position; it will have
> to be moved below Features et al, eventually. Making this change, but
> heads up that it necessitates another patch in the order enforcement
> series.

Yes.

>> >  #
>> >  # Features:
>> >  # @variant1-feat: a feature
>> > @@ -206,7 +205,8 @@
>> >
>> >  ##
>> >  # @cmd-boxed:
>> > -# If you're bored enough to read this, go see a video of boxed cats
>> > +#     If you're bored enough to read this, go see a video of boxed
>> > +#     cats
>> >  #
>> >  # Features:
>> >  # @cmd-feat1: a feature
>> > diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
>> > index 371dd25ffc7..8c0818a3f0d 100644
>> > --- a/tests/qapi-schema/doc-good.out
>> > +++ b/tests/qapi-schema/doc-good.out
>> > @@ -126,13 +126,11 @@ doc symbol=Base
>> >   minimally indented
>> >  doc symbol=Variant1
>> >      Intro
>> > +    A paragraph
>> >
>> > -    Plain
>> > -A paragraph
>> > +    Another paragraph
>> >
>> > -Another paragraph
>> > -
>> > -@var1 is undocumented
>> > +    @var1 is undocumented
>> >      Member=var1
>> >
>> >      Feature=variant1-feat
>> > @@ -213,9 +211,8 @@ Note::
>> >  2.10
>> >  doc symbol=cmd-boxed
>> >      Intro
>> > -
>> > -    Plain
>> > -If you're bored enough to read this, go see a video of boxed cats
>> > +    If you're bored enough to read this, go see a video of boxed
>> > +    cats
>> >      Feature=cmd-feat1
>> >  a feature
>> >      Feature=cmd-feat2
>>
>> I'm mildly surprised that the intro's indentation isn't stripped.  Maybe
>> we discussed that already, and I forgot.  Anyway, it works, and changing
>> it is way out of scope right now.
>
> *searching resident databanks*
>
> I think I was striving for minimal processing of the text prior to
> handoff to sphinx for reasons of preserving accurate source
> information.
>
> qapidoc.py has this code:
> ```
>     def visit_plaintext(self, section: QAPIDoc.Section) -> None:
>         # Squelch empty paragraphs.
>         if not section.text:
>             return
>
>         # Intro sections, which are indented in QAPI source, need to
>         # be dedented to avoid accidental block quotes in ReST syntax.
>         dedent = bool(section.kind == QAPIDoc.Kind.INTRO)
>         self.ensure_blank_line()
>         self.add_lines(section.text, section.info, dedent)
>         self.ensure_blank_line()
> ```
>
> As a result, the unit test plaintext versions retain that indentation.
> This actually matches how we treat indentation for member text, which
> is also preserved and represented in the plaintext test output!
>
> Granted, now that I have excised the backwards compatibility demon
> from qapidoc, it is possible we can conduct another audit on source
> information preservation and some things might be able to be
> simplified, but I think this is fine and good for now.

Maybe, eventually.  You got far more interesting work piled up that I
want to merge.

[...]



  reply	other threads:[~2026-09-23  6:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 20:51 [PATCH 0/9] qapi: convert intros for qga, firmware, etc John Snow
2026-09-21 20:51 ` [PATCH 1/9] qapi: convert remaining simple sections John Snow
2026-09-22 14:34   ` Markus Armbruster
2026-09-21 20:51 ` [PATCH 3/9] qapi: convert trivial intros for qga/qapi-schema.json John Snow
2026-09-21 20:51 ` [PATCH 4/9] qapi: convert simple " John Snow
2026-09-23  6:47   ` Markus Armbruster
2026-09-21 20:51 ` [PATCH 6/9] qapi: split " John Snow
2026-09-22 15:21   ` Markus Armbruster
2026-09-21 20:51 ` [PATCH 7/9] qapi: convert intro sections for docs/interop/firmware.json John Snow
2026-09-22 15:04   ` Markus Armbruster
2026-09-22 17:41     ` John Snow
2026-09-21 20:51 ` [PATCH 8/9] qapi: convert intro sections for docs/interop/vhost-user.json John Snow
     [not found] ` <20260921205147.1857168-6-jsnow@redhat.com>
2026-09-22 14:53   ` [PATCH 5/9] qapi: split intros at natural cutoff points for qga/qapi-schema.json Markus Armbruster
2026-09-22 17:33     ` John Snow
     [not found] ` <20260921205147.1857168-3-jsnow@redhat.com>
2026-09-22 17:05   ` [PATCH 2/9] qapi: convert intro sections for unit tests Markus Armbruster
2026-09-22 17:29     ` John Snow
2026-09-23  6:35       ` Markus Armbruster [this message]
     [not found] ` <20260921205147.1857168-10-jsnow@redhat.com>
2026-09-22 17:10   ` [PATCH 9/9] tests/qapi: generate output in source order Markus Armbruster
2026-09-22 17:46     ` John Snow
2026-09-23  6:32       ` Markus Armbruster
2026-09-22 17:47 ` [PATCH 0/9] qapi: convert intros for qga, firmware, etc John Snow
2026-09-22 19:48   ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878q4szd9a.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=jsnow@redhat.com \
    --cc=kchamart@redhat.com \
    --cc=kkostiuk@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=michael.roth@amd.com \
    --cc=mjt@tls.msk.ru \
    --cc=mst@redhat.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.