qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-devel@nongnu.org, eblake@redhat.com
Subject: Re: [PATCH v2 00/33] qapi: docs: width=70 and two spaces between sentences
Date: Wed, 29 Oct 2025 11:25:15 +0100	[thread overview]
Message-ID: <877bweqa2c.fsf@pond.sub.org> (raw)
In-Reply-To: <3f9153b1-ba52-4f30-ac31-3916d9ee2ea5@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Wed, 29 Oct 2025 12:28:35 +0300")

Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:

> On 29.10.25 11:29, Markus Armbruster wrote:
>> Daniel P. Berrangé <berrange@redhat.com> writes:
>> 
>>> On Sat, Oct 11, 2025 at 05:04:06PM +0300, Vladimir Sementsov-Ogievskiy wrote:
>>>> Hi all!
>>>>
>>>> Let's bring the documentation in line with the requirements. And
>>>> do check these requirements in QAPI parser.
>>>
>>> This implicitly assumes that the requirements are desirable.
>>>
>>> This is a large number of patches, showing the requirements are widely
>>> ignored today. When I look at the changes in the patches my overwhealming
>>> reaction is that they are not beneficial, which in turn makes me believe
>>> the requirements should be changed to match the reality of the code,
>>> rather than the reverse.
>>
>> A QAPI schema contains four distinct kinds of text:
>>
>> 1. Schema code
>>
>> 2. Example code in comments
>>
>> 3. Doc comments less example code, i.e. prose
>>
>> 4. Non-doc comments
>>
>> This series touches all four.
>
> I'm unsure about [1.]. What do you mean? The series touch only comments.
>
> I now check:
>
>  git diff 37137ae582 HEAD | grep '^[+-][^#+-]'
>
> where 37137ae582 is first commit "qapi: Add documentation format validation"
> for me, and this grep finds nothing..

You're right.  Cross-eyed, I guess %-}

> Assume [4.] is a tiny part.

Yes.

>> "The requirements" refers to docs/devel/qapi-code-gen.rst section
>> Documentation comments / Documentation markup:
>>
>>      For legibility, wrap text paragraphs so every line is at most 70
>>      characters long.
>>
>>      Separate sentences with two spaces.
>>
>> I've explained why these rules make sense a number of times, and I'm
>> happy to explain again if needed.
>>
>> Note this applies only to doc comments.
>>
>> I've been enforcing it manually for prose.  Whether it should be
>> enforced for example code is debatable.  Let's focus on prose.
>>
>> "Widely ignored" is not true, and I have numbers to back that up.
>>
>> We have some 20,000 lines of doc comments in the main QAPI schema and
>> the QGA QAPI schema.  Some 3,000 lines are examples.  That leaves a bit
>> over 17,000 lines of prose in 48 files.
>>
>> If I drop the changes to the other three kinds from Vladimir's series,
>> and add a few more prose changes he missed
>
> Hmm it surprises me.. Does it mean that the check added in patch 01 misses
> some violations?

I found a few more paragraphs to reflow for reasons other than long
lines, a few extra blank lines, a few missing blank lines, and slightly
off indentation in a few places.  None of this I expect your code to
catch.

I found a few errors in your patch, like this one in PATCH 13:

    @@ -620,7 +622,8 @@
     ##
     # @NumaCpuOptions:
     #
    -# Option "-numa cpu" overrides default cpu to node mapping.  It accepts
    +# Option "-numa cpu" overrides default cpu to node mapping.  It
    +#     accepts
     # the same set of cpu properties as returned by
     # `query-hotpluggable-cpus[].props <query-hotpluggable-cpus>`, where
     # node-id could be used to override default node mapping.
    @@ -686,7 +689,8 @@

They made me feel useful ;)

I also found a few single spaces that should be double.  Maybe the code
could be improved to catch them.

>>, I get this diffstat:
>>   24 files changed, 351 insertions(+), 332 deletions(-)
>
> Compare with original diffstat:
>
>  33 files changed, 713 insertions(+), 704 deletions(-)
>
> So obviously, touching up code examples makes the series twice more invasive.
>
> I agree, to at least postpone examples changing. And the series show, that in many
> cases there are no obvious possibility to satisfy restrictions for examples.
>
> Hmm, probably, we want another limit for examples? 90 characters? Anyway, not in this
> series.

I figure code in examples should be treated just like "real" code.

Avoiding long prose lines is easy.  When I reflowed the entire QAPI
schema documentation to stay within the limit (commit a937b6aa739), not
a single line break was awkward.

Code is unlike prose: it's often more deeply indented, and it contains
more longer words (identifiers).  Because of that, a long code line can
be less bad than an awkward line break.  Use your judgement.

devel/style.rst thus advises:

    Line width
    ==========

    Lines should be 80 characters; try not to make them longer.

    Sometimes it is hard to do, especially when dealing with QEMU subsystems
    that use long function or symbol names. If wrapping the line at 80 columns
    is obviously less readable and more awkward, prefer not to wrap it; better
    to have an 85 character line than one which is awkwardly wrapped.

    Even in that case, try not to make lines much longer than 80 characters.
    (The checkpatch script will warn at 100 characters, but this is intended
    as a guard against obviously-overlength lines, not a target.)



  reply	other threads:[~2025-10-29 10:26 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-11 14:04 [PATCH v2 00/33] qapi: docs: width=70 and two spaces between sentences Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 01/33] qapi: Add documentation format validation Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 02/33] qapi/acpi.json: docs: width=70 and two spaces between sentences Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 03/33] qapi/audio.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 04/33] qapi/block-core.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 05/33] qapi/block-export.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 06/33] qapi/block.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 07/33] qapi/char.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 08/33] qapi/crypto.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 09/33] qapi/dump.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 10/33] qapi/introspect.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 11/33] qapi/job.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 12/33] qapi/machine-s390x.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 13/33] qapi/machine.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 14/33] qapi/migration.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 15/33] qapi/misc-arm.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 16/33] qapi/misc-i386.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 17/33] qapi/misc.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 18/33] qapi/net.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 19/33] qapi/qdev.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 20/33] qapi/qom.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 21/33] qapi/replay.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 22/33] qapi/rocker.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 23/33] qapi/run-state.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 24/33] qapi/sockets.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 25/33] qapi/stats.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 26/33] qapi/tpm.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 27/33] qapi/trace.json: " Vladimir Sementsov-Ogievskiy
2025-10-14 18:22   ` Stefan Hajnoczi
2025-10-11 14:04 ` [PATCH v2 28/33] qapi/transaction.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 29/33] qapi/ui.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 30/33] qapi/vfio.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 31/33] qapi/virtio.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 32/33] qga/qapi-schema.json: " Vladimir Sementsov-Ogievskiy
2025-10-11 14:04 ` [PATCH v2 33/33] qapi/acpi-hest.json: " Vladimir Sementsov-Ogievskiy
2025-10-13  8:11 ` [PATCH v2 00/33] qapi: " Daniel P. Berrangé
2025-10-15 14:11   ` Vladimir Sementsov-Ogievskiy
2025-10-29  8:29   ` Markus Armbruster
2025-10-29  9:28     ` Vladimir Sementsov-Ogievskiy
2025-10-29 10:25       ` Markus Armbruster [this message]
2025-10-29  9:08 ` Markus Armbruster
2025-10-29  9:24   ` Vladimir Sementsov-Ogievskiy
2025-10-29 10:31     ` 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=877bweqa2c.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@yandex-team.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).