Skip to content

Commit

Permalink
qapi: Require descriptions and tagged sections to be indented
Browse files Browse the repository at this point in the history
By convention, we indent the second and subsequent lines of
descriptions and tagged sections, except for examples.

Turn this into a hard rule, and apply it to examples, too.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240216145841.2099240-11-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
[Straightforward conflicts in qapi/migration.json resolved]
  • Loading branch information
Markus Armbruster committed Feb 26, 2024
1 parent 56c64dd commit d23055b
Show file tree
Hide file tree
Showing 28 changed files with 2,318 additions and 2,316 deletions.
15 changes: 7 additions & 8 deletions docs/devel/qapi-code-gen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ commands and events), member (for structs and unions), branch (for
alternates), or value (for enums), a description of each feature (if
any), and finally optional tagged sections.

Descriptions start with '\@name:'. The description text should be
Descriptions start with '\@name:'. The description text must be
indented like this::

# @name: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
Expand All @@ -997,8 +997,8 @@ A tagged section starts with one of the following words:
"Note:"/"Notes:", "Since:", "Example:"/"Examples:", "Returns:",
"TODO:". The section ends with the start of a new section.

The second and subsequent lines of sections other than
"Example"/"Examples" should be indented like this::
The second and subsequent lines of tagged sections must be indented
like this::

# Note: Ut enim ad minim veniam, quis nostrud exercitation ullamco
# laboris nisi ut aliquip ex ea commodo consequat.
Expand Down Expand Up @@ -1049,11 +1049,10 @@ For example::
#
# Example:
#
# -> { "execute": "query-blockstats" }
# <- {
# ... lots of output ...
# }
#
# -> { "execute": "query-blockstats" }
# <- {
# ... lots of output ...
# }
##
{ 'command': 'query-blockstats',
'data': { '*query-nodes': 'bool' },
Expand Down
20 changes: 10 additions & 10 deletions qapi/acpi.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@
#
# Example:
#
# -> { "execute": "query-acpi-ospm-status" }
# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
# { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
# { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
# { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
# ]}
# -> { "execute": "query-acpi-ospm-status" }
# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
# { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
# { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
# { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
# ]}
##
{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }

Expand All @@ -133,10 +133,10 @@
#
# Example:
#
# <- { "event": "ACPI_DEVICE_OST",
# "data": { "info": { "device": "d1", "slot": "0",
# "slot-type": "DIMM", "source": 1, "status": 0 } },
# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
# <- { "event": "ACPI_DEVICE_OST",
# "data": { "info": { "device": "d1", "slot": "0",
# "slot-type": "DIMM", "source": 1, "status": 0 } },
# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
##
{ 'event': 'ACPI_DEVICE_OST',
'data': { 'info': 'ACPIOSTInfo' } }

0 comments on commit d23055b

Please sign in to comment.