xemu/scripts/qapi
Markus Armbruster bf83f04e13 qapi: Fix doc comment checking for commands and events
When a command's 'data' is an object, its doc comment describes the
arguments defined there.  When 'data' names a type, the doc comment
does not describe arguments.  Instead, the doc generator inserts a
pointer to the named type.

An event's doc comment works the same.

We don't actually check doc comments for commands and events.
Instead, QAPISchema._def_command() forwards the doc comment to the
implicit argument type, where it gets checked.  Works because the
check only cares for the implicit argument type's members.

Not only is this needlessly hard to understand, it actually falls
apart in two cases:

* When 'data' is empty, there is nothing to forward to, and the doc
  comment remains unchecked.  Demonstrated by test doc-bad-event-arg.

* When 'data' names a type, we can't forward, as the type has its own
  doc comment.  The command or event's doc comment remains unchecked.
  Demonstrated by test doc-bad-boxed-command-arg.

The forwarding goes back to commit 069fb5b250 "qapi: Prepare for
requiring more complete documentation", put to use in commit
816a57cd6e "qapi: Fix detection of bogus member documentation".  That
fix was incomplete.

To fix this, make QAPISchemaCommand and QAPISchemaEvent check doc
comments, and drop the forwarding of doc comments to implicit argument
types.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20191024110237.30963-12-armbru@redhat.com>
2019-10-29 07:35:16 +01:00
..
__init__.py qapi-gen: New common driver for code and doc generators 2018-03-02 13:14:09 -06:00
commands.py qapi: Add feature flags to commands 2019-10-22 13:54:13 +02:00
common.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
doc.py qapi: Fix doc comment checking for commands and events 2019-10-29 07:35:16 +01:00
error.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
events.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
expr.py qapi: Add feature flags to commands 2019-10-22 13:54:13 +02:00
gen.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
introspect.py qapi: Add feature flags to commands 2019-10-22 13:54:13 +02:00
parser.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
schema.py qapi: Fix doc comment checking for commands and events 2019-10-29 07:35:16 +01:00
source.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
types.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
visit.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00