From d23055b8db88a54b372ebbbffe3681169d2a767a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 16 Feb 2024 15:58:34 +0100 Subject: qapi: Require descriptions and tagged sections to be indented MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Message-ID: <20240216145841.2099240-11-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé [Straightforward conflicts in qapi/migration.json resolved] --- scripts/qapi/parser.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts/qapi/parser.py') diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 3aefec1c2b..f8da315332 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -492,6 +492,9 @@ class QAPIDoc: # indeterminate indentation if self.text != '': # non-blank, non-first line determines indentation + if indent == 0: + raise QAPIParseError( + self._parser, "line needs to be indented") self._indent = indent elif indent < self._indent: raise QAPIParseError( -- cgit v1.2.3