From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633035540725865.3894722743269; Thu, 30 Sep 2021 13:59:00 -0700 (PDT) Received: from localhost ([::1]:47224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW38t-0000xU-Bk for importer@patchew.org; Thu, 30 Sep 2021 16:58:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37O-0006oD-Qi for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37L-0008Og-Fj for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:26 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-9-CkCPCO50OSKfNoF46UNHSw-1; Thu, 30 Sep 2021 16:57:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 753AE1891E81; Thu, 30 Sep 2021 20:57:19 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C25560936; Thu, 30 Sep 2021 20:57:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r8V+Ogw9WNH215AikDA20SvTc2Qpd8O1Clg8V3SoAp4=; b=TfoVS2//dG6u6fFPs6XnDQSX4FAqDn/3vIfx/9mChPBZEThOUH7RL6KY306dIGotpMe5tx 8nQrOxJ+f96mtfpnbh0igGFOWTXj1XoY4cQAbu8ZiKFroS90t8OvvtTQnv+E/yUSvjq2Zs mKnnup1qomQtPPPMqW7Kkc/oTAa8GiU= X-MC-Unique: CkCPCO50OSKfNoF46UNHSw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 01/13] qapi/pylintrc: ignore 'consider-using-f-string' warning Date: Thu, 30 Sep 2021 16:57:04 -0400 Message-Id: <20210930205716.1148693-2-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633035541447100001 Content-Type: text/plain; charset="utf-8" Pylint 2.11.x adds this warning. We're not yet ready to pursue that conversion, so silence it for now. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index c5275d5f59b..5b7dbc58ad8 100644 --- a/scripts/qapi/pylintrc +++ b/scripts/qapi/pylintrc @@ -23,6 +23,7 @@ disable=3Dfixme, too-many-branches, too-many-statements, too-many-instance-attributes, + consider-using-f-string, =20 [REPORTS] =20 --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633035541218247.58659181748567; Thu, 30 Sep 2021 13:59:01 -0700 (PDT) Received: from localhost ([::1]:47236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW38t-0000xw-U0 for importer@patchew.org; Thu, 30 Sep 2021 16:58:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37P-0006oW-4C for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43387) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37L-0008PN-N1 for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:26 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-584-CKQfk2qvOw6sTn1W6dovlA-1; Thu, 30 Sep 2021 16:57:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A68C479EDD; Thu, 30 Sep 2021 20:57:20 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C2D05BAE5; Thu, 30 Sep 2021 20:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vp1Z6jUrVyI8dXf9JGLwFdI3q50mjfk9QTys8vLuwTg=; b=IA3D8NDvJyXWXRIFOCBUIUYlQ/JHY0XxLx4NfhDyoLNOi+zJUyEVyBFh9qiX25nGa+IFxO BIHKRS0UuS6X4vDl7mTDXTHRJNq5cODMXbDFZw6xtNVunqcaUFa3YNVT8yUbO7HJeV3zQF pQxNqZu+KbgVp1+oZlG2g57ZBnhxMOk= X-MC-Unique: CKQfk2qvOw6sTn1W6dovlA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 02/13] qapi/gen: use dict.items() to iterate over _modules Date: Thu, 30 Sep 2021 16:57:05 -0400 Message-Id: <20210930205716.1148693-3-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633035543135100003 Content-Type: text/plain; charset="utf-8" New pylint warning. I could silence it, but this is the only occurrence in the entire tree, including everything in iotests/ and python/. Easier to just change this one instance. (The warning is emitted in cases where you are fetching the values anyway, so you may as well just take advantage of the iterator to avoid redundant lookups.) Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/gen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index ab26d5c937a..2ec1e7b3b68 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -296,10 +296,9 @@ def _temp_module(self, name: str) -> Iterator[None]: self._current_module =3D old_module =20 def write(self, output_dir: str, opt_builtins: bool =3D False) -> None: - for name in self._module: + for name, (genc, genh) in self._module.items(): if QAPISchemaModule.is_builtin_module(name) and not opt_builti= ns: continue - (genc, genh) =3D self._module[name] genc.write(output_dir) genh.write(output_dir) =20 --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633035547632779.8935083933809; Thu, 30 Sep 2021 13:59:07 -0700 (PDT) Received: from localhost ([::1]:47716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW390-0001HP-HC for importer@patchew.org; Thu, 30 Sep 2021 16:59:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37T-0006ww-SA for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37R-0008W2-1Z for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-571-4ApiqRCcNUu62HbkMfle0A-1; Thu, 30 Sep 2021 16:57:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DBB88189CD26; Thu, 30 Sep 2021 20:57:21 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3E7D60936; Thu, 30 Sep 2021 20:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V+hHX4akG1U0gFoXljzpl8hFTLN2S9vvA0s7cJ1Au1M=; b=H64TahVLIxJyNX7uv4qztR/xqtRyMFWxpG5aBMXkssoRjEH6nCpq/wXqIAyk/WUK+i8/Ai NDQtiLNsxDIW8r3QWfgeVEKr2wQk66yoAm90GK45LZFMu5s5b1v2uO/OgF16qb9fxD5MlV i/D6j/IBVQst0FerwJekoyddiKOrKsc= X-MC-Unique: 4ApiqRCcNUu62HbkMfle0A-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 03/13] qapi/parser: fix unused check_args_section arguments Date: Thu, 30 Sep 2021 16:57:06 -0400 Message-Id: <20210930205716.1148693-4-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633035549645100002 Content-Type: text/plain; charset="utf-8" Pylint informs us we're not using these arguments. Oops, it's right. Correct the error message and remove the remaining unused parameter. Fix test output now that the error message is improved. Fixes: e151941d1b Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/parser.py | 16 +++++++++------- tests/qapi-schema/doc-bad-feature.err | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index f03ba2cfec8..bfd2dbfd9a2 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -753,16 +753,18 @@ def check_expr(self, expr): =20 def check(self): =20 - def check_args_section(args, info, what): + def check_args_section(args, what): bogus =3D [name for name, section in args.items() if not section.member] if bogus: raise QAPISemError( self.info, - "documented member%s '%s' %s not exist" - % ("s" if len(bogus) > 1 else "", - "', '".join(bogus), - "do" if len(bogus) > 1 else "does")) + "documented %s%s '%s' %s not exist" % ( + what, + "s" if len(bogus) > 1 else "", + "', '".join(bogus), + "do" if len(bogus) > 1 else "does" + )) =20 - check_args_section(self.args, self.info, 'members') - check_args_section(self.features, self.info, 'features') + check_args_section(self.args, 'member') + check_args_section(self.features, 'feature') diff --git a/tests/qapi-schema/doc-bad-feature.err b/tests/qapi-schema/doc-= bad-feature.err index e4c62adfa3e..49d1746c3d1 100644 --- a/tests/qapi-schema/doc-bad-feature.err +++ b/tests/qapi-schema/doc-bad-feature.err @@ -1 +1 @@ -doc-bad-feature.json:3: documented member 'a' does not exist +doc-bad-feature.json:3: documented feature 'a' does not exist --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633036061389627.7242840240025; Thu, 30 Sep 2021 14:07:41 -0700 (PDT) Received: from localhost ([::1]:34526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3HI-0003Iy-51 for importer@patchew.org; Thu, 30 Sep 2021 17:07:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37Q-0006pt-U8 for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37P-0008TH-2k for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-255-5dT_x9ZjMimTROt0dcdacg-1; Thu, 30 Sep 2021 16:57:24 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0BD418F508; Thu, 30 Sep 2021 20:57:23 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 136D65BAE1; Thu, 30 Sep 2021 20:57:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0KCb6iNGYUzpcG61oVv8RDctCBUpQc4Md8uKwiAchp0=; b=YC82vOV9MxtFy3FMDUNj0cNSORfFcRpnVI/6If7PL9Kkavcn+N9CdbtzUDZ3m9NY+NSVYi rofRPwJFteqlgJxaFvySk0dgAa1isrIqLKFPZobIvWje9TJFwHkT35h1ZVJSXOepMRpHZI tceKq/y6i1L4vdpzDDqdP6rkvFOfZfo= X-MC-Unique: 5dT_x9ZjMimTROt0dcdacg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 04/13] qapi: Add spaces after symbol declaration for consistency Date: Thu, 30 Sep 2021 16:57:07 -0400 Message-Id: <20210930205716.1148693-5-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633036063266100001 Content-Type: text/plain; charset="utf-8" Several QGA definitions omit a blank line after the symbol declaration. This works OK currently, but it's the only place where we do this. Adjust it for consistency. Future commits may wind up enforcing this formatting. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- This isn't strictly necessary and I don't actually get around to enforcing it in this series, but I figured I'd share it with the list anyway. We can just drop this patch but I wanted to see your thoughts. Signed-off-by: John Snow --- qapi/block-core.json | 1 + qga/qapi-schema.json | 3 +++ tests/qapi-schema/doc-good.json | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index 4114f8b6fc3..52a6dae9522 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3132,6 +3132,7 @@ =20 ## # @BlockdevQcow2EncryptionFormat: +# # @aes: AES-CBC with plain64 initialization vectors # # Since: 2.10 diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index c60f5e669d7..94e4aacdcc6 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -1140,6 +1140,7 @@ =20 ## # @GuestExec: +# # @pid: pid of child process in guest OS # # Since: 2.5 @@ -1171,6 +1172,7 @@ =20 ## # @GuestHostName: +# # @host-name: Fully qualified domain name of the guest OS # # Since: 2.10 @@ -1197,6 +1199,7 @@ =20 ## # @GuestUser: +# # @user: Username # @domain: Logon domain (windows only) # @login-time: Time of login of this user on the computer. If multiple diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.j= son index a20acffd8b9..86dc25d2bd8 100644 --- a/tests/qapi-schema/doc-good.json +++ b/tests/qapi-schema/doc-good.json @@ -53,6 +53,7 @@ =20 ## # @Enum: +# # @one: The _one_ {and only} # # Features: @@ -67,6 +68,7 @@ =20 ## # @Base: +# # @base1: # the first member ## @@ -75,6 +77,7 @@ =20 ## # @Variant1: +# # A paragraph # # Another paragraph (but no @var: line) @@ -91,11 +94,13 @@ =20 ## # @Variant2: +# ## { 'struct': 'Variant2', 'data': {} } =20 ## # @Object: +# # Features: # @union-feat1: a feature ## @@ -109,6 +114,7 @@ =20 ## # @Alternate: +# # @i: an integer # @b is undocumented # @@ -126,6 +132,7 @@ =20 ## # @cmd: +# # @arg1: the first argument # # @arg2: the second @@ -175,6 +182,7 @@ =20 ## # @EVT_BOXED: +# # Features: # @feat3: a feature ## --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633035547720705.4288527796184; Thu, 30 Sep 2021 13:59:07 -0700 (PDT) Received: from localhost ([::1]:47798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW390-0001Kn-LA for importer@patchew.org; Thu, 30 Sep 2021 16:59:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37S-0006tb-Dl for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37Q-0008Vf-Mm for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:30 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-208-4JBOAeoPMG--1vkYwoxxZA-1; Thu, 30 Sep 2021 16:57:25 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 599F5802947; Thu, 30 Sep 2021 20:57:24 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3699C60936; Thu, 30 Sep 2021 20:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6GS5VDi9xzUI5VOfRjL0L/Nzcx9R7MRvJGeqmfWwEi0=; b=ge1v4sDk0JyaFdW3xD2kCMadaEjCHP1I9wjK+gI+tPAzy6L+bdD3InB8Lo1kXOm0Kh+FUM k7gC9xcxC5P4MW53HjAlO2L56Sv3AtteXpqNFunOhEM8O2G0X5zvnO0y35Q2sqFhcqfU7v Z/FT1lpQ519mEq9Df/u0qfquxNV5VPk= X-MC-Unique: 4JBOAeoPMG--1vkYwoxxZA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 05/13] qapi/parser: remove FIXME comment from _append_body_line Date: Thu, 30 Sep 2021 16:57:08 -0400 Message-Id: <20210930205716.1148693-6-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633035549636100001 Content-Type: text/plain; charset="utf-8" True, we do not check the validity of this symbol -- but we don't check the validity of definition names during parse, either -- that happens later, during the expr check. I don't want to introduce a dependency on expr.py:check_name_str here and introduce a cycle. Instead, rest assured that a documentation block is required for each definition. This requirement uses the names of each section to ensure that we fulfilled this requirement. e.g., let's say that block-core.json has a comment block for "Snapshot!Info" by accident. We'll see this error message: In file included from ../../qapi/block.json:8: ../../qapi/block-core.json: In struct 'SnapshotInfo': ../../qapi/block-core.json:38: documentation comment is for 'Snapshot!Info' That's a pretty decent error message. Now, let's say that we actually mangle it twice, identically: ../../qapi/block-core.json: In struct 'Snapshot!Info': ../../qapi/block-core.json:38: struct has an invalid name That's also pretty decent. If we forget to fix it in both places, we'll just be back to the first error. Therefore, let's just drop this FIXME and adjust the error message to not imply a more thorough check than is actually performed. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/parser.py | 6 ++++-- tests/qapi-schema/doc-empty-symbol.err | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index bfd2dbfd9a2..23898ab1dcd 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -556,9 +556,11 @@ def _append_body_line(self, line): if not line.endswith(':'): raise QAPIParseError(self._parser, "line should end with '= :'") self.symbol =3D line[1:-1] - # FIXME invalid names other than the empty string aren't flagg= ed + # Invalid names are not checked here, but the name provided MU= ST + # match the following definition, which *is* validated in expr= .py. if not self.symbol: - raise QAPIParseError(self._parser, "invalid name") + raise QAPIParseError( + self._parser, "name required after '@'") elif self.symbol: # This is a definition documentation block if name.startswith('@') and name.endswith(':'): diff --git a/tests/qapi-schema/doc-empty-symbol.err b/tests/qapi-schema/doc= -empty-symbol.err index 81b90e882a7..aa51be41b2d 100644 --- a/tests/qapi-schema/doc-empty-symbol.err +++ b/tests/qapi-schema/doc-empty-symbol.err @@ -1 +1 @@ -doc-empty-symbol.json:4:1: invalid name +doc-empty-symbol.json:4:1: name required after '@' --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633035894880476.6534862032893; Thu, 30 Sep 2021 14:04:54 -0700 (PDT) Received: from localhost ([::1]:55768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3Eb-0006pA-US for importer@patchew.org; Thu, 30 Sep 2021 17:04:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37U-0006yA-AR for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37R-0008WD-MU for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:32 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-479-2HeouSo1MFiKJRAIWInDow-1; Thu, 30 Sep 2021 16:57:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 920081007908; Thu, 30 Sep 2021 20:57:25 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8578B60938; Thu, 30 Sep 2021 20:57:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YjX8mxuTEAZ9UunXBwdfn3+qU4GJyKnM5z2g4e1x4bs=; b=BdTTC5VYkMYZpYBhDcIOwfG6tuJtLsOCxHYaiYN8Emya+tkJCBWJ19U7KLQ2sP36FwCq5O +51erM9WsZcTvOr6rlb6rmEdqHt5d1n77Qg3D5KcULsOXnzrvtbd/wugNGfqUwL/a32yZh Y3eXEbcLOrgNvOVCwU/U/dDwYwpyWyY= X-MC-Unique: 2HeouSo1MFiKJRAIWInDow-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 06/13] qapi/parser: clarify _end_section() logic Date: Thu, 30 Sep 2021 16:57:09 -0400 Message-Id: <20210930205716.1148693-7-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633035895927100001 Content-Type: text/plain; charset="utf-8" The "if self._section" clause in end_section is mysterious: In which circumstances might we end a section when we don't have one? QAPIDoc always expects there to be a "current section", only except after a call to end_comment(). This actually *shouldn't* ever be 'None', so let's remove that logic so I don't wonder why it's like this again in three months. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/parser.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 23898ab1dcd..82f1d952b13 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -718,13 +718,21 @@ def _start_section(self, name=3DNone, indent=3D0): self.sections.append(self._section) =20 def _end_section(self): - if self._section: - text =3D self._section.text =3D self._section.text.strip() - if self._section.name and (not text or text.isspace()): - raise QAPIParseError( - self._parser, - "empty doc section '%s'" % self._section.name) - self._section =3D None + assert self._section is not None + + text =3D self._section.text =3D self._section.text.strip() + + # Only the 'body' section is allowed to have an empty body. + # All other sections, including anonymous ones, must have text. + if self._section !=3D self.body and not text: + # We do not create anonymous sections unless there is + # something to put in them; this is a parser bug. + assert self._section.name + raise QAPIParseError( + self._parser, + "empty doc section '%s'" % self._section.name) + + self._section =3D None =20 def _append_freeform(self, line): match =3D re.match(r'(@\S+:)', line) --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633036174989117.31522773349866; Thu, 30 Sep 2021 14:09:34 -0700 (PDT) Received: from localhost ([::1]:40826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3J7-0007cZ-Ro for importer@patchew.org; Thu, 30 Sep 2021 17:09:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37U-0006yb-GU for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37R-0008WH-NJ for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:32 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-eUXdK5GVMPuzshgJjycl9w-1; Thu, 30 Sep 2021 16:57:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B2C1D814707; Thu, 30 Sep 2021 20:57:26 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFD905BAF3; Thu, 30 Sep 2021 20:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XVoVVh21zBcGPmu266grzEy5Qtc9X3Tp/2KP3hidR8Y=; b=OzIbVz5T3uEuIIpkOn64HfZIcGOHwfG4nobJalR29FEOPdWWgfwz2WncMQ4HwTfvH3Mbd0 k/VgP9VVocS06jdLIQIT8cWdxNILSX1vqWKar9dvGjM1BDLPhIt2yjz7XtVnvzJiCZWbfD BVw9WGcE3Dr26U8Lsd6pwPkmeaqRsxg= X-MC-Unique: eUXdK5GVMPuzshgJjycl9w-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 07/13] qapi/parser: Introduce NullSection Date: Thu, 30 Sep 2021 16:57:10 -0400 Message-Id: <20210930205716.1148693-8-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633036175917100001 Content-Type: text/plain; charset="utf-8" Here's the weird bit. QAPIDoc generally expects -- virtually everywhere -- that it will always have a current section. The sole exception to this is in the case that end_comment() is called, which leaves us with *no* section. However, in this case, we also don't expect to actually ever mutate the comment contents ever again. NullSection is just a Null-object that allows us to maintain the invariant that we *always* have a current section, enforced by static typing -- allowing us to type that field as QAPIDoc.Section instead of the more ambiguous Optional[QAPIDoc.Section]. end_section is renamed to switch_section and now accepts as an argument the new section to activate, clarifying that no callers ever just unilaterally end a section; they only do so when starting a new section. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- For my money: Optional types can be a nuisance because an unfamiliar reader may wonder in what circumstances the field may be unset. This makes the condition quite a bit more explicit and statically provable. Doing it in this way (and not by creating a mutable dummy section) will also continue to reject (rather noisily) any erroneous attempts to append additional lines after end_comment() has been called. Also, this section isn't indexed into .sections[] and isn't really visible in any way to external users of the class, so it seems like a harmless and low-cost way to formalize the "life cycle" of a QAPIDoc parser. Clean and clear as I can make it, in as few lines as I could muster. Signed-off-by: John Snow --- scripts/qapi/parser.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 82f1d952b13..40c5da4b172 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -478,6 +478,13 @@ def __init__(self, parser, name, indent=3D0): def connect(self, member): self.member =3D member =20 + class NullSection(Section): + """ + Immutable dummy section for use at the end of a doc block. + """ + def append(self, line): + assert False, "Text appended after end_comment() called." + def __init__(self, parser, info): # self._parser is used to report errors with QAPIParseError. The # resulting error position depends on the state of the parser. @@ -525,7 +532,7 @@ def append(self, line): self._append_line(line) =20 def end_comment(self): - self._end_section() + self._switch_section(QAPIDoc.NullSection(self._parser)) =20 @staticmethod def _is_section_tag(name): @@ -699,9 +706,9 @@ def _start_symbol_section(self, symbols_dict, name, ind= ent): raise QAPIParseError(self._parser, "'%s' parameter name duplicated" % name) assert not self.sections - self._end_section() - self._section =3D QAPIDoc.ArgSection(self._parser, name, indent) - symbols_dict[name] =3D self._section + new_section =3D QAPIDoc.ArgSection(self._parser, name, indent) + self._switch_section(new_section) + symbols_dict[name] =3D new_section =20 def _start_args_section(self, name, indent): self._start_symbol_section(self.args, name, indent) @@ -713,13 +720,11 @@ def _start_section(self, name=3DNone, indent=3D0): if name in ('Returns', 'Since') and self.has_section(name): raise QAPIParseError(self._parser, "duplicated '%s' section" % name) - self._end_section() - self._section =3D QAPIDoc.Section(self._parser, name, indent) - self.sections.append(self._section) - - def _end_section(self): - assert self._section is not None + new_section =3D QAPIDoc.Section(self._parser, name, indent) + self._switch_section(new_section) + self.sections.append(new_section) =20 + def _switch_section(self, new_section): text =3D self._section.text =3D self._section.text.strip() =20 # Only the 'body' section is allowed to have an empty body. @@ -732,7 +737,7 @@ def _end_section(self): self._parser, "empty doc section '%s'" % self._section.name) =20 - self._section =3D None + self._section =3D new_section =20 def _append_freeform(self, line): match =3D re.match(r'(@\S+:)', line) --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633035901456566.3090625748252; Thu, 30 Sep 2021 14:05:01 -0700 (PDT) Received: from localhost ([::1]:56082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3Eh-00071X-2f for importer@patchew.org; Thu, 30 Sep 2021 17:04:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37X-00076f-Br for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60364) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37V-00008G-80 for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:35 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-248--pwNX5UMNECWoK4e3hNlXA-1; Thu, 30 Sep 2021 16:57:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CFB10100790E; Thu, 30 Sep 2021 20:57:27 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE47060938; Thu, 30 Sep 2021 20:57:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sP2hUZwS7EDUfocpquC0RQaDc+27DCP/OXm49ig30Kg=; b=UfZgcKwqjM7x7j7IGPfx6avR8ZjMKsV5GW7jEHsulrf1mSC8IJOvRlnR1HZSedgpgjT29P qUYi2rhIlVAdxaQjEwgdO9u4fZDs4/8IgHWPgNbWkuQtEpaNDJO49WymEy4JFXx3xJmdEe uaY2THnYuBgaNrlVsVlngpTQ1x7lBuA= X-MC-Unique: -pwNX5UMNECWoK4e3hNlXA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 08/13] qapi/parser: add import cycle workaround Date: Thu, 30 Sep 2021 16:57:11 -0400 Message-Id: <20210930205716.1148693-9-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633035902372100001 Content-Type: text/plain; charset="utf-8" Adding static types causes a cycle in the QAPI generator: [schema -> expr -> parser -> schema]. It exists because the QAPIDoc class needs the names of types defined by the schema module, but the schema module needs to import both expr.py/parser.py to do its actual parsing. Ultimately, the layering violation is that parser.py should not have any knowledge of specifics of the Schema. QAPIDoc performs double-duty here both as a parser *and* as a finalized object that is part of the schema. In this patch, add the offending type hints alongside the workaround to avoid the cycle becoming a problem at runtime. See https://mypy.readthedocs.io/en/latest/runtime_troubles.html#import-cycles for more information on this workaround technique. I see three ultimate resolutions here: (1) Just keep this patch and use the TYPE_CHECKING trick to eliminate the cycle which is only present during static analysis. (2) Don't bother to annotate connect_member() et al, give them 'object' or 'Any'. I don't particularly like this, because it diminishes the usefulness of type hints for documentation purposes. Still, it's an extremely quick fix. (3) Reimplement doc <--> definition correlation directly in schema.py, integrating doc fields directly into QAPISchemaMember and relieving the QAPIDoc class of the responsibility. Users of the information would instead visit the members first and retrieve their documentation instead of the inverse operation -- visiting the documentation and retrieving their members. My preference is (3), but in the short-term (1) is the easiest way to have my cake (strong type hints) and eat it too (Not have import cycles). Do (1) for now, but plan for (3). Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/parser.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 40c5da4b172..75582ddb003 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -18,6 +18,7 @@ import os import re from typing import ( + TYPE_CHECKING, Dict, List, Optional, @@ -30,6 +31,12 @@ from .source import QAPISourceInfo =20 =20 +if TYPE_CHECKING: + # pylint: disable=3Dcyclic-import + # TODO: Remove cycle. [schema -> expr -> parser -> schema] + from .schema import QAPISchemaFeature, QAPISchemaMember + + # Return value alias for get_expr(). _ExprValue =3D Union[List[object], Dict[str, object], str, bool] =20 @@ -473,9 +480,9 @@ def append(self, line): class ArgSection(Section): def __init__(self, parser, name, indent=3D0): super().__init__(parser, name, indent) - self.member =3D None + self.member: Optional['QAPISchemaMember'] =3D None =20 - def connect(self, member): + def connect(self, member: 'QAPISchemaMember') -> None: self.member =3D member =20 class NullSection(Section): @@ -747,14 +754,14 @@ def _append_freeform(self, line): % match.group(1)) self._section.append(line) =20 - def connect_member(self, member): + def connect_member(self, member: 'QAPISchemaMember') -> None: if member.name not in self.args: # Undocumented TODO outlaw self.args[member.name] =3D QAPIDoc.ArgSection(self._parser, member.name) self.args[member.name].connect(member) =20 - def connect_feature(self, feature): + def connect_feature(self, feature: 'QAPISchemaFeature') -> None: if feature.name not in self.features: raise QAPISemError(feature.info, "feature '%s' lacks documentation" --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633036068679240.04760959326097; Thu, 30 Sep 2021 14:07:48 -0700 (PDT) Received: from localhost ([::1]:35084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3HP-0003hP-HR for importer@patchew.org; Thu, 30 Sep 2021 17:07:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37l-0007QQ-Go for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37X-0000An-Nk for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:49 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-PwwuPOBGN4Gf-16eMxv6qA-1; Thu, 30 Sep 2021 16:57:30 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 748C7824FA8; Thu, 30 Sep 2021 20:57:29 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08A9960938; Thu, 30 Sep 2021 20:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l+BxMSJw5WST6w2PIk1+yqse+4FodTaDC6C4vCfFFk0=; b=LDOB3gFUCmw39nUoOD8/QI0xv6ruvkP3AB8aSf/gm2jAIkV2k8tCaviTeXKpmtrwu8vl2t cdM/CLgCv7Z35EZ6l8AIwJk9Q7MpIMNyFllvDVuudptEs3oSq+O3XoHVvPGlpmbG0xfMlP f2npK3OQTRnjilP8It9yGt2dHZlgO2Y= X-MC-Unique: PwwuPOBGN4Gf-16eMxv6qA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 09/13] qapi/parser: add type hint annotations (QAPIDoc) Date: Thu, 30 Sep 2021 16:57:12 -0400 Message-Id: <20210930205716.1148693-10-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633036070309100001 Content-Type: text/plain; charset="utf-8" Annotations do not change runtime behavior. This commit consists of only annotations. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/parser.py | 67 ++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 75582ddb003..73c1c4ef599 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -37,6 +37,9 @@ from .schema import QAPISchemaFeature, QAPISchemaMember =20 =20 +#: Represents a single Top Level QAPI schema expression. +TopLevelExpr =3D Dict[str, object] + # Return value alias for get_expr(). _ExprValue =3D Union[List[object], Dict[str, object], str, bool] =20 @@ -454,7 +457,8 @@ class QAPIDoc: """ =20 class Section: - def __init__(self, parser, name=3DNone, indent=3D0): + def __init__(self, parser: QAPISchemaParser, + name: Optional[str] =3D None, indent: int =3D 0): # parser, for error messages about indentation self._parser =3D parser # optional section name (argument/member or section name) @@ -463,7 +467,7 @@ def __init__(self, parser, name=3DNone, indent=3D0): # the expected indent level of the text of this section self._indent =3D indent =20 - def append(self, line): + def append(self, line: str) -> None: # Strip leading spaces corresponding to the expected indent le= vel # Blank lines are always OK. if line: @@ -478,7 +482,8 @@ def append(self, line): self.text +=3D line.rstrip() + '\n' =20 class ArgSection(Section): - def __init__(self, parser, name, indent=3D0): + def __init__(self, parser: QAPISchemaParser, + name: str, indent: int =3D 0): super().__init__(parser, name, indent) self.member: Optional['QAPISchemaMember'] =3D None =20 @@ -489,35 +494,34 @@ class NullSection(Section): """ Immutable dummy section for use at the end of a doc block. """ - def append(self, line): + def append(self, line: str) -> None: assert False, "Text appended after end_comment() called." =20 - def __init__(self, parser, info): + def __init__(self, parser: QAPISchemaParser, info: QAPISourceInfo): # self._parser is used to report errors with QAPIParseError. The # resulting error position depends on the state of the parser. # It happens to be the beginning of the comment. More or less # servicable, but action at a distance. self._parser =3D parser self.info =3D info - self.symbol =3D None + self.symbol: Optional[str] =3D None self.body =3D QAPIDoc.Section(parser) - # dict mapping parameter name to ArgSection - self.args =3D OrderedDict() - self.features =3D OrderedDict() - # a list of Section - self.sections =3D [] + # dicts mapping parameter/feature names to their ArgSection + self.args: Dict[str, QAPIDoc.ArgSection] =3D OrderedDict() + self.features: Dict[str, QAPIDoc.ArgSection] =3D OrderedDict() + self.sections: List[QAPIDoc.Section] =3D [] # the current section self._section =3D self.body self._append_line =3D self._append_body_line =20 - def has_section(self, name): + def has_section(self, name: str) -> bool: """Return True if we have a section with this name.""" for i in self.sections: if i.name =3D=3D name: return True return False =20 - def append(self, line): + def append(self, line: str) -> None: """ Parse a comment line and add it to the documentation. =20 @@ -538,18 +542,18 @@ def append(self, line): line =3D line[1:] self._append_line(line) =20 - def end_comment(self): + def end_comment(self) -> None: self._switch_section(QAPIDoc.NullSection(self._parser)) =20 @staticmethod - def _is_section_tag(name): + def _is_section_tag(name: str) -> bool: return name in ('Returns:', 'Since:', # those are often singular or plural 'Note:', 'Notes:', 'Example:', 'Examples:', 'TODO:') =20 - def _append_body_line(self, line): + def _append_body_line(self, line: str) -> None: """ Process a line of documentation text in the body section. =20 @@ -591,7 +595,7 @@ def _append_body_line(self, line): # This is a free-form documentation block self._append_freeform(line) =20 - def _append_args_line(self, line): + def _append_args_line(self, line: str) -> None: """ Process a line of documentation text in an argument section. =20 @@ -637,7 +641,7 @@ def _append_args_line(self, line): =20 self._append_freeform(line) =20 - def _append_features_line(self, line): + def _append_features_line(self, line: str) -> None: name =3D line.split(' ', 1)[0] =20 if name.startswith('@') and name.endswith(':'): @@ -669,7 +673,7 @@ def _append_features_line(self, line): =20 self._append_freeform(line) =20 - def _append_various_line(self, line): + def _append_various_line(self, line: str) -> None: """ Process a line of documentation text in an additional section. =20 @@ -705,7 +709,11 @@ def _append_various_line(self, line): =20 self._append_freeform(line) =20 - def _start_symbol_section(self, symbols_dict, name, indent): + def _start_symbol_section( + self, + symbols_dict: Dict[str, 'QAPIDoc.ArgSection'], + name: str, + indent: int) -> None: # FIXME invalid names other than the empty string aren't flagged if not name: raise QAPIParseError(self._parser, "invalid parameter name") @@ -717,13 +725,14 @@ def _start_symbol_section(self, symbols_dict, name, i= ndent): self._switch_section(new_section) symbols_dict[name] =3D new_section =20 - def _start_args_section(self, name, indent): + def _start_args_section(self, name: str, indent: int) -> None: self._start_symbol_section(self.args, name, indent) =20 - def _start_features_section(self, name, indent): + def _start_features_section(self, name: str, indent: int) -> None: self._start_symbol_section(self.features, name, indent) =20 - def _start_section(self, name=3DNone, indent=3D0): + def _start_section(self, name: Optional[str] =3D None, + indent: int =3D 0) -> None: if name in ('Returns', 'Since') and self.has_section(name): raise QAPIParseError(self._parser, "duplicated '%s' section" % name) @@ -731,7 +740,7 @@ def _start_section(self, name=3DNone, indent=3D0): self._switch_section(new_section) self.sections.append(new_section) =20 - def _switch_section(self, new_section): + def _switch_section(self, new_section: 'QAPIDoc.Section') -> None: text =3D self._section.text =3D self._section.text.strip() =20 # Only the 'body' section is allowed to have an empty body. @@ -746,7 +755,7 @@ def _switch_section(self, new_section): =20 self._section =3D new_section =20 - def _append_freeform(self, line): + def _append_freeform(self, line: str) -> None: match =3D re.match(r'(@\S+:)', line) if match: raise QAPIParseError(self._parser, @@ -768,14 +777,16 @@ def connect_feature(self, feature: 'QAPISchemaFeature= ') -> None: % feature.name) self.features[feature.name].connect(feature) =20 - def check_expr(self, expr): + def check_expr(self, expr: TopLevelExpr) -> None: if self.has_section('Returns') and 'command' not in expr: raise QAPISemError(self.info, "'Returns:' is only valid for commands") =20 - def check(self): + def check(self) -> None: =20 - def check_args_section(args, what): + def check_args_section( + args: Dict[str, QAPIDoc.ArgSection], what: str + ) -> None: bogus =3D [name for name, section in args.items() if not section.member] if bogus: --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633036063451978.4161928749996; Thu, 30 Sep 2021 14:07:43 -0700 (PDT) Received: from localhost ([::1]:34706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3HK-0003Qf-G6 for importer@patchew.org; Thu, 30 Sep 2021 17:07:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37Z-0007BW-Hc for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27164) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37W-00009g-7O for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:36 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-24-5VQOdkZrN26WjGeXesqnUw-1; Thu, 30 Sep 2021 16:57:32 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53CD418A0760; Thu, 30 Sep 2021 20:57:31 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2DEB60936; Thu, 30 Sep 2021 20:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RVw3YUIVL0AjNH5KmB6MOM66HR2FeG7OGEMMKcDp76U=; b=BZYbNgc6AQ92rJXdEpHYiExcvtcqZsmP+NHeKTTusLB6mQk58nU4RMge1vbm7poy62ex8p kU7tUSXuGAOVXjWjIeAXRA5XazArm7SKC43OawEAfQnQqACha7MQ2kd99wzEccJoCplqg8 HkMXXsv3dyqZSeTqQ0MwfE2QezkkhOI= X-MC-Unique: 5VQOdkZrN26WjGeXesqnUw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 10/13] qapi/parser: Add FIXME for consolidating JSON-related types Date: Thu, 30 Sep 2021 16:57:13 -0400 Message-Id: <20210930205716.1148693-11-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633036065608100001 Content-Type: text/plain; charset="utf-8" The fix for this comment is forthcoming in a future commit, but this will keep me honest. The linting configuration in ./python/setup.cfg prohibits 'FIXME' comments. A goal of this long-running series is to move ./scripts/qapi to ./python/qemu/qapi so that the QAPI generator is regularly type-checked by GitLab CI. This comment is a time-bomb to force me to address this issue prior to that step. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 73c1c4ef599..0265b47b955 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -43,6 +43,10 @@ # Return value alias for get_expr(). _ExprValue =3D Union[List[object], Dict[str, object], str, bool] =20 +# FIXME: Consolidate and centralize definitions for TopLevelExpr, +# _ExprValue, _JSONValue, and _JSONObject; currently scattered across +# several modules. + =20 class QAPIParseError(QAPISourceError): """Error class for all QAPI schema parsing errors.""" --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633036350318533.617961567189; Thu, 30 Sep 2021 14:12:30 -0700 (PDT) Received: from localhost ([::1]:44962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3Lx-0002Be-Ax for importer@patchew.org; Thu, 30 Sep 2021 17:12:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37Z-0007B3-12 for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33250) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37X-0000Ai-CC for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:36 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-2HoIibs6NlWhQxAKNNIsIg-1; Thu, 30 Sep 2021 16:57:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2AFE824FA6; Thu, 30 Sep 2021 20:57:32 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E61B60936; Thu, 30 Sep 2021 20:57:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jtp/JKbPV04AKCYORABaL829YO1xhXEIzuagpsk0mqQ=; b=UzgYN44ZfzZfRZuImbUcb1rGUCzdxEdpuTmwJZbumx25wN09bDqJ8KWUv5zB0lGxZT2keE LjCk948El2NDVEQrNrfyW5qbiiYyqjkTlBSMfn2rd4/Jbdlbrf/cwE8esB6/EYB51nwL/+ t2KcOvcPJYcKA9PvDZlwgmVkugksq3o= X-MC-Unique: 2HoIibs6NlWhQxAKNNIsIg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 11/13] qapi/parser: enable mypy checks Date: Thu, 30 Sep 2021 16:57:14 -0400 Message-Id: <20210930205716.1148693-12-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633036350890100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- As always, this can be merged with the previous commit. Signed-off-by: John Snow --- scripts/qapi/mypy.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini index 54ca4483d6d..66253564297 100644 --- a/scripts/qapi/mypy.ini +++ b/scripts/qapi/mypy.ini @@ -3,11 +3,6 @@ strict =3D True disallow_untyped_calls =3D False python_version =3D 3.6 =20 -[mypy-qapi.parser] -disallow_untyped_defs =3D False -disallow_incomplete_defs =3D False -check_untyped_defs =3D False - [mypy-qapi.schema] disallow_untyped_defs =3D False disallow_incomplete_defs =3D False --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633036419563315.0997222020835; Thu, 30 Sep 2021 14:13:39 -0700 (PDT) Received: from localhost ([::1]:47404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3N4-0003qm-B9 for importer@patchew.org; Thu, 30 Sep 2021 17:13:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37b-0007Gd-63 for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38145) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37Z-0000D1-LU for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:38 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-558-syZhYKk-Ml61bYeya4XL0Q-1; Thu, 30 Sep 2021 16:57:35 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E1FA118D6A30; Thu, 30 Sep 2021 20:57:34 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id D11E45BAEB; Thu, 30 Sep 2021 20:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Jmi6+RCv7x9NBewHsdzUAL+Tv6vOijY++oX/h3SQ4Y=; b=d08YWU7eXSC1Uci8lIA5eyufpJjT5YQaiEM0s8TaYPixCcBbr2kgJUV0AeZJqTNnAflXWi obc0FyfrgL+gsiZP7d9q9DTCwqGJXwSdiYs6h5XN8VTjFfyx0lfI71xL6mxz5zzqi+1Fl5 PruKyRU3YYfJeLbWKb6x9KVA56M9fbI= X-MC-Unique: syZhYKk-Ml61bYeya4XL0Q-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 12/13] qapi/parser: Silence too-few-public-methods warning Date: Thu, 30 Sep 2021 16:57:15 -0400 Message-Id: <20210930205716.1148693-13-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633036421467100001 Content-Type: text/plain; charset="utf-8" Eh. Not worth the fuss today. There are bigger fish to fry. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 0265b47b955..1b006cdc133 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -461,8 +461,10 @@ class QAPIDoc: """ =20 class Section: + # pylint: disable=3Dtoo-few-public-methods def __init__(self, parser: QAPISchemaParser, name: Optional[str] =3D None, indent: int =3D 0): + # parser, for error messages about indentation self._parser =3D parser # optional section name (argument/member or section name) @@ -498,6 +500,7 @@ class NullSection(Section): """ Immutable dummy section for use at the end of a doc block. """ + # pylint: disable=3Dtoo-few-public-methods def append(self, line: str) -> None: assert False, "Text appended after end_comment() called." =20 --=20 2.31.1 From nobody Sat May 11 17:02:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633036483589594.277091442259; Thu, 30 Sep 2021 14:14:43 -0700 (PDT) Received: from localhost ([::1]:49460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3O6-0005Ih-Hv for importer@patchew.org; Thu, 30 Sep 2021 17:14:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37c-0007L9-L3 for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW37b-0000E3-0Z for qemu-devel@nongnu.org; Thu, 30 Sep 2021 16:57:40 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-576-6A2GXiXtPqiWmFFSupVxrA-1; Thu, 30 Sep 2021 16:57:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F05C8015C7; Thu, 30 Sep 2021 20:57:36 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.9.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CFCF5BAE1; Thu, 30 Sep 2021 20:57:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633035458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UDYbapQxshJAqowJIOeSLVyA+LsWk2oGYns7Zw7QZJM=; b=im+Xb+B36r8hZ9Q7L0NTkJ30xC7FImdZ/dJpk1jKX3ljpsdAXv+RGIl1tLb29W2NAf+XZ7 aT1v2L7+RlNOwYaZeVfS8GlxcK6ewT0BlIsCNqP5mtdyPjymcFbpB5s5ipPhqZVS0UzlGn B2EBEefC8Tlk39nRAzl6LgM8VkvL5xE= X-MC-Unique: 6A2GXiXtPqiWmFFSupVxrA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v4 13/13] qapi/parser: enable pylint checks Date: Thu, 30 Sep 2021 16:57:16 -0400 Message-Id: <20210930205716.1148693-14-jsnow@redhat.com> In-Reply-To: <20210930205716.1148693-1-jsnow@redhat.com> References: <20210930205716.1148693-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Michael Roth , Markus Armbruster , Eric Blake , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1633036484489100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- This can be merged with the previous commit, if desired. Signed-off-by: John Snow --- scripts/qapi/pylintrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index 5b7dbc58ad8..b259531a726 100644 --- a/scripts/qapi/pylintrc +++ b/scripts/qapi/pylintrc @@ -2,8 +2,7 @@ =20 # Add files or directories matching the regex patterns to the ignore list. # The regex matches against base names, not paths. -ignore-patterns=3Dparser.py, - schema.py, +ignore-patterns=3Dschema.py, =20 =20 [MESSAGES CONTROL] --=20 2.31.1