From: John Snow Date: Wed, 4 Oct 2023 23:05:32 +0000 (-0400) Subject: qapi: re-establish linting baseline X-Git-Tag: v8.2.0-rc0~60^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6c5d159ce8e2f8e4cf5a0cd58de12167dd72311;p=thirdparty%2Fqemu.git qapi: re-establish linting baseline Some very minor housekeeping to make the linters happy once more. Signed-off-by: John Snow Message-ID: <20231004230532.3002201-4-jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Markus Armbruster --- diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index bf5716b5f30..5412716617a 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -13,8 +13,8 @@ from contextlib import contextmanager import os -import sys import re +import sys from typing import ( Dict, Iterator, diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 22e7bcc4b1b..bf31018aef0 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -22,6 +22,7 @@ from typing import ( Dict, List, Mapping, + Match, Optional, Set, Union, @@ -563,11 +564,11 @@ class QAPIDoc: self._switch_section(QAPIDoc.NullSection(self._parser)) @staticmethod - def _match_at_name_colon(string: str): + def _match_at_name_colon(string: str) -> Optional[Match[str]]: return re.match(r'@([^:]*): *', string) @staticmethod - def _match_section_tag(string: str): + def _match_section_tag(string: str) -> Optional[Match[str]]: return re.match(r'(Returns|Since|Notes?|Examples?|TODO): *', string) def _append_body_line(self, line: str) -> None: