You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/scripts/qapi
John Snow 636c96cd77 qapi: Fix undocumented return values by generating something
Generated command documentation lacks information on return value in
several cases, e.g. query-tpm.

The obvious fix would be to require a Returns: section when a command
returns something.

However, note that many existing Returns: sections are pretty useless:
the description is basically the return type, which then gets rendered
like "Return: <Type> – <basically the return type>".  This suggests
that a description is often not really necessary, and requiring one
isn't useful.

Instead, generate the obvious minimal thing when Returns: is absent:
"Return: <Type>".

This auto-generated Return documentation is placed is as follows:

1. If we have arguments, return goes right after them.
2. Else if we have errors, return goes right before them.
3. Else if we have features, return goes right before them.
4. Else return goes right after the intro

To facilitate this algorithm, a "TODO:" hack line is used to separate
the intro from the remainder of the documentation block in cases where
there are no other sections to separate the intro from e.g. examples and
additional detail meant to appear below the key sections of interest.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20250711051045.51110-3-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[_insert_near_kind() code replaced by something simpler, commit
message amended to explain why we're doing this]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
5 days ago
..
__init__.py
backend.py qapi: Add some pylint ignores 1 month ago
commands.py qapi: expose all schema features to code 5 months ago
common.py qapi: Smarter camel_to_upper() to reduce need for 'prefix' 10 months ago
error.py qapi/error: Add type hints 4 years ago
events.py qapi: Move include/qapi/qmp/ to include/qobject/ 5 months ago
expr.py qapi: Fix to reject 'data': 'mumble' in struct 2 years ago
features.py qapi: expose all schema features to code 5 months ago
gen.py qapi: expose all schema features to code 5 months ago
introspect.py qapi/introspect: Use @dataclass to simplify 4 months ago
main.py scripts/qapi/backend: Clean up create_backend()'s failure mode 4 months ago
parser.py qapi: Fix undocumented return values by generating something 5 days ago
pylintrc python: add qapi static analysis tests 1 month ago
schema.py qapi: Fix undocumented return values by generating something 5 days ago
source.py qapi/source: allow multi-line QAPISourceInfo advancing 4 months ago
types.py qapi: expose all schema features to code 5 months ago
visit.py qapi: expose all schema features to code 5 months ago