From nobody Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633169059; cv=none; d=zohomail.com; s=zohoarc; b=WKov/T1SAb0sqgOBK5KBC0bQkoC6BhOn/VreaWlAjeWp16M/V60MUKlNw8mIaMUsli9ImmOdpu29grcWH6Mj/OdWeVhBpIQXzSr3obV/gYTe0R+X1euVPy2hjZ334QOkYbACfivgGBYGytAJs9tYR/rKhxhUHgU1xzJllJfniG8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633169059; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4iiRC/Mtke44PdD+JXKYGB3o1c4BdkEOFvSH10/yXj0=; b=aPeoykOG9PgvQktNZGtCfILD5ARd8i8AKh5dcDkjQLRJnfg/i6DqI3bId0220quQVTL6M6dmbMGacnvYzxNICrM29fsLQpvlk4A4oGHynrh2GM3ZWzwDJ5PvpI+QFpGA7rVNyfs+3vYny31oEbJAiBe1rduozzVBGQHeGovAvbc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633169059578879.9159259866324; Sat, 2 Oct 2021 03:04:19 -0700 (PDT) Received: from localhost ([::1]:51128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbsQ-00073l-FC for importer@patchew.org; Sat, 02 Oct 2021 06:04:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblR-00016G-63 for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblN-0004K9-2j for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:04 -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-538-qLv3Pk_fOSuv6sONOehoZQ-1; Sat, 02 Oct 2021 05:56:57 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 05E681808313; Sat, 2 Oct 2021 09:56:57 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCEF719D9B; Sat, 2 Oct 2021 09:56:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6AED2113861E; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168619; 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=4iiRC/Mtke44PdD+JXKYGB3o1c4BdkEOFvSH10/yXj0=; b=hvpD9aoNZAxxwovxLZfIzUWBjSoAWrUHyRn/0Ho2EG05xixoaq2xKmNUGHJpsfWvksVtFn 3ch2az0y49M6EZnmnDvOd1TGq0sifELQiWiTTOhOrdudu5WGOe/9J0Y9lXI0O8ftHkLwQ0 TusPOU/Ov4SlYPrj7bQ+Bi9bG2MZKCg= X-MC-Unique: qLv3Pk_fOSuv6sONOehoZQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 01/13] qapi/pylintrc: ignore 'consider-using-f-string' warning Date: Sat, 2 Oct 2021 11:56:43 +0200 Message-Id: <20211002095655.1944970-2-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633169060349100001 Content-Type: text/plain; charset="utf-8" From: John Snow 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 Message-Id: <20210930205716.1148693-2-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index c5275d5f59..5b7dbc58ad 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633168718; cv=none; d=zohomail.com; s=zohoarc; b=CskiDbPq25gsYIwjY4jDvGop1+3NDs55uPyG0oqegBkKaLeS77CdYF+JSdAxSNC11fOVXmQerEMx8SWdu9/mGF+MMwRyU5uBdABBoBKUItkVM16QsHxxd/UAj5ojQ++uw6pSI4dQN7uI3WCCBa4X2dXT1jvuetSsAW3dwFhmsCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633168718; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oy4+SHO4PF3l02718HYamFngRt9dTMV090CwwZean1Q=; b=lekjOiOhjnB4/0ysdR9i/HC1NwANr0e/ugJoRdJXGbgQcROTwNHlgZDkqBMXEQE6VVWQb9l2xAopCBMl9Dt3OlU/X8qep+otI3sI1bAsAPzsZe10Vr02WwR3snH85xOKN9lT7IFRSmmNBLXKjCWL3heG8CTAmdFVw+Gfotpn1Jg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633168718287789.9112407583767; Sat, 2 Oct 2021 02:58:38 -0700 (PDT) Received: from localhost ([::1]:33894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbmv-0003nS-9H for importer@patchew.org; Sat, 02 Oct 2021 05:58:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblQ-000166-U4 for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblN-0004Jy-1m for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:04 -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-169-6TNPdDiyO6CYT2MZrj4PYA-1; Sat, 02 Oct 2021 05:56:58 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 04A4E802C87; Sat, 2 Oct 2021 09:56:57 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCD4660BF4; Sat, 2 Oct 2021 09:56:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 72B7F11385C1; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168619; 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=oy4+SHO4PF3l02718HYamFngRt9dTMV090CwwZean1Q=; b=Tliu7wbg6P6UvxjGAfxiNhmJUObU2w6Z0qt5DMwQpa62ymIgeddnPVZbFqXSCKbKiShKUI uD2M2xxJRO14lblRvqKHgWIyAFYm+ovNtv4S5EAFjenDP18wA+1jNibDzh3SnWcP3+e7Q/ ApOv6FF9IbEjEcm5eoNz3vUARlYzpjQ= X-MC-Unique: 6TNPdDiyO6CYT2MZrj4PYA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 02/13] qapi/gen: use dict.items() to iterate over _modules Date: Sat, 2 Oct 2021 11:56:44 +0200 Message-Id: <20211002095655.1944970-3-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633168720125100001 Content-Type: text/plain; charset="utf-8" From: John Snow 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 Message-Id: <20210930205716.1148693-3-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-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 ab26d5c937..2ec1e7b3b6 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633169338; cv=none; d=zohomail.com; s=zohoarc; b=IQS7C/33LBacnYKhd6JuYZrmsBUFdjeynpsvVCMFDTJcObrKoeUiUpYbJb0etOE/cKXaeWvTQLwqLsNbT4MkuW9cnNhZmkZTfAhfVwlKAA3Uv6wz/f93heYtYelMR9ScFlXaQ1d2NOXbp0qldOaJKfyP+BIjrH8g6H/sNS2xVRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633169338; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BqmFVoiTVjs8tvTiE9gE/QJL+B7YMW9/oO7UhH+jNvg=; b=b/yvbEzA55vZdnji07KTWHFasOEZLoV5+k1KdtaRLrVNKgiGttjV6SI2GXQORaZ6HDF2yZ0pfza7B9LSXBThvmRwzeWJJRttg45XS5Xpp0VYDo1I8nArCWjIpY164Pw4w5UpJbQM9tNyuSMsVbwj9GyBnXbeN++SRiFNae6dZC0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633169338703732.5864845273738; Sat, 2 Oct 2021 03:08:58 -0700 (PDT) Received: from localhost ([::1]:37188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbwv-0008Hg-PX for importer@patchew.org; Sat, 02 Oct 2021 06:08:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWbla-0001A5-Iu for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblS-0004Vn-Ir for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:12 -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-539-rNrez117N-67MslsDNmKvg-1; Sat, 02 Oct 2021 05:57:02 -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 C0E711006AA7; Sat, 2 Oct 2021 09:57:01 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB5B76060F; Sat, 2 Oct 2021 09:56:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 760FF11385C3; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168626; 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=BqmFVoiTVjs8tvTiE9gE/QJL+B7YMW9/oO7UhH+jNvg=; b=WEyfUh+0L47FOI3gaka60dZ8kZpNLyvzZL+fw2e9H6s3KvYRLZ0QoT+/9IxYElGZCPaypy KvoqkOYexralnF3t9VNJIHr8qoy0HKO5REbvZR4rRbpQJs621Qqwl4byfIK1ctfwgbrx2t mgjkBArveWL4JRWTGxxqboUgsMprJrQ= X-MC-Unique: rNrez117N-67MslsDNmKvg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 03/13] qapi/parser: fix unused check_args_section arguments Date: Sat, 2 Oct 2021 11:56:45 +0200 Message-Id: <20211002095655.1944970-4-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@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=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633169338985100001 Content-Type: text/plain; charset="utf-8" From: John Snow 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 Message-Id: <20210930205716.1148693-4-jsnow@redhat.com> [Commit message formatting tweaked] Reviewed-by: Markus Armbruster Signed-off-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 f03ba2cfec..bfd2dbfd9a 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 e4c62adfa3..49d1746c3d 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633168892; cv=none; d=zohomail.com; s=zohoarc; b=enTy6NlqPPWcFubeE/oiePx4i4F6C6Vidjvuu9jn2JCgsUcf0QP2+JBrwCmyD/tlSpALWUbxRhs+dnO6u1JQI1Gvm7GY0c7n5cFEE84JF/tUJvHPc43G/D0EDVVX9xufZDt+F4NxjT/+Rct5qQyVajgKcxahmAqpiybFeQGCToM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633168892; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aF6oJ+cMuBEvm2wLYFiGdSjkyr9ogvEyg+a4WCN7LGg=; b=GOB0ORL4+0QVInbcU3g2tnrFp7NStSCvXPlpC4quzsdmNS5RGMO26EOUtE7dtlFv4y32Fl1qtLrkqy/NrybEc9l56uzQ1UQlVqo2NV8DdSdB2CC8olXCmfGsaLOEFbfZng1Pb3fwDA3L5MTTucIcmu5iQ5kf+Bznkhrd8JYWhCg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633168892490659.0598027678108; Sat, 2 Oct 2021 03:01:32 -0700 (PDT) Received: from localhost ([::1]:42628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbpj-00019Y-66 for importer@patchew.org; Sat, 02 Oct 2021 06:01:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblR-00016F-5z for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblN-0004K5-20 for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:04 -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-175-NjZZQVi7OjecNiEnpOdA1Q-1; Sat, 02 Oct 2021 05:56:58 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 05BB61808312; Sat, 2 Oct 2021 09:56:57 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCCA110016F4; Sat, 2 Oct 2021 09:56:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 796B31138526; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168619; 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=aF6oJ+cMuBEvm2wLYFiGdSjkyr9ogvEyg+a4WCN7LGg=; b=E7c5ncZA3yoTNFkgccDKY+fszMDwJWIzMdev1BcKQ+J0+85tZ6PE5AqV8gA8Lq4qXiKmxU RugHOcX+RsmGQkYbym2SCm6jKvylLI5izBtkBiMursuWXNCZJVSsOtZ4ufe19cWiJAuzMD dCK+2ao7fIWOiIhyqhZBxtiJ5sv00L4= X-MC-Unique: NjZZQVi7OjecNiEnpOdA1Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 04/13] qapi: Add spaces after symbol declaration for consistency Date: Sat, 2 Oct 2021 11:56:46 +0200 Message-Id: <20211002095655.1944970-5-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633169795382100001 Content-Type: text/plain; charset="utf-8" From: John Snow 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 Message-Id: <20210930205716.1148693-5-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- 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 623a4f4a3f..6d3217abb6 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 c60f5e669d..94e4aacdcc 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 a20acffd8b..86dc25d2bd 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633169224; cv=none; d=zohomail.com; s=zohoarc; b=VGC7NKKl+db5puSZs8iJTQZJHTKEZVJh1U0Nz/6p/CgWKoeDH93WDW7cKBBehLFY39VEe+g9Fzb4OWckkR0q+NKU6eCZxBdpwfId2+KrTJdKWpIdTY/IxScEdGQasAZOzeGJbGsGIxrG330iRnvAKW4H/SwYDPmGNhBxLNec1BM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633169224; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JrQNbndszkbyLnVgSiSsMNLAJoKPYsBG8U4pLvwlImo=; b=n2b5o7aOY1+Dw0WL5Et0NDoDuB524eCtO75/z7P6zSZdH+RJj+8lQK/HwFilxvMNqXaFtMRtIbw7N7u/Qy5xSc73c8+DctV0xwQdZ9StK7Y/+9hwhzQdhheboMvfTEJkm8rl6QfE10WodtFNrevDc7w89StCPc6LLNvpF1vDt2g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633169224746239.54596814599654; Sat, 2 Oct 2021 03:07:04 -0700 (PDT) Received: from localhost ([::1]:58816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbv5-0003sj-P1 for importer@patchew.org; Sat, 02 Oct 2021 06:07:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblW-00018a-L3 for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37130) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblQ-0004Uy-Pk for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:08 -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-527-mWG9qA2WMmGt7dflj0-luA-1; Sat, 02 Oct 2021 05:56:59 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 666CE1006AA2; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39C3660BF4; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7CAB31138529; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168624; 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=JrQNbndszkbyLnVgSiSsMNLAJoKPYsBG8U4pLvwlImo=; b=daPyszjfkgoj09t8PV6EqT12h4CUoVJOz6H3TBaIlqKnee3vZ5AJbAQhj/3os4/9kMvF9K cOpAEbF9eXI95OuZ2ZDwbCNeThfu/wUq3JxBCSbV1SvQowyWfc7bsG5PZ2j69vzP8aK0pw kUkoYwQ/EbF6Sn09RaMz5tfkiLUODoQ= X-MC-Unique: mWG9qA2WMmGt7dflj0-luA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 05/13] qapi/parser: remove FIXME comment from _append_body_line Date: Sat, 2 Oct 2021 11:56:47 +0200 Message-Id: <20211002095655.1944970-6-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633169225553100001 Content-Type: text/plain; charset="utf-8" From: John Snow 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 Message-Id: <20210930205716.1148693-6-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-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 bfd2dbfd9a..23898ab1dc 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 81b90e882a..aa51be41b2 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633169064; cv=none; d=zohomail.com; s=zohoarc; b=VkNh040izn+3TC+wMDHXuVYP9DxY0ELjY1AZ4YPyRiRRgBmMFukDC7PrPfpHolWeEPl1m4B7sY2OgiHk1pILQFYtRFRSSFktpsTCvVtl/ZJMcNnybacT1TQ9Yoh6Fltwgy5wCPbggSomuHOH1XyvGk9sZBlD7tfVseGz/H4mtIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633169064; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ewEhHNMZ9HzzuUu9Vrt1DJ9bxzWVjAvMXEvq9EQE4v0=; b=CUcGHAWRh6r89gTMcWnlh65KBljKQWkkV/cnEl18GT7V6VJKf3m2nb2T/Z4fEwE6PO3c8JJlmjuswDesBT7r06ESy8JEt7mR8siT2ZyTKJFL42j/wayDG8+P5RlfcUkxPrPWvo9dPFJ6m7B0GrLQoCEtfxW/avAO8LY42B5YXKg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633169064874615.4094905951919; Sat, 2 Oct 2021 03:04:24 -0700 (PDT) Received: from localhost ([::1]:51356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbsU-0007DI-89 for importer@patchew.org; Sat, 02 Oct 2021 06:04:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblU-00017X-Oa for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblP-0004SV-B5 for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:07 -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-533-P898IASUMka7RpTUbK4cRg-1; Sat, 02 Oct 2021 05:57:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4EEFA1808310; Sat, 2 Oct 2021 09:57:00 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 392AF5D6B1; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7FFEE113853B; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168622; 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=ewEhHNMZ9HzzuUu9Vrt1DJ9bxzWVjAvMXEvq9EQE4v0=; b=ZBP/qbNeYHndC3w6QPxJ00lpI//f1LYrcsvSvbGuXqataJTN+u7mXR6kNSmIjyHlxS9eRn NO5IuLEcbtcL8QX/Bb9l7cHQ/9lroKPqaAh4cJYU+vNsu5HMMkqbQ3OrA3v31JZU0ovHjn Uyg0QrQXT2qwV4uDdVwCbrSj5Oa0oBE= X-MC-Unique: P898IASUMka7RpTUbK4cRg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 06/13] qapi/parser: clarify _end_section() logic Date: Sat, 2 Oct 2021 11:56:48 +0200 Message-Id: <20211002095655.1944970-7-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633169066699100001 Content-Type: text/plain; charset="utf-8" From: John Snow 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 Message-Id: <20210930205716.1148693-7-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-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 23898ab1dc..82f1d952b1 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633168719; cv=none; d=zohomail.com; s=zohoarc; b=M9OPmn/kX6X7X5BKTQGitzEV92aj7qn6Y21QDewLmMc/AlFf84JcWwQ9WxVN1ScBCmIJ+FSzX+2OdC7Y6XzxbhrW3oa3JKY2NiU270j1hxY5W+wsqj84j0dTb+upIOchLaGH3Qllow0IkeIR9LcMXqSQmuufQhQCSVuaSysxznQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633168719; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qMfn+KDKDXb3a8VinVn4bpWUD0UAYmWDXtYSpLs+RpI=; b=W67Ay+9HvXJfu8bQ0g3IhjT1PVajaVCguu6C09vpU6SMFwWdDlSypPSBGtPfC+cGFiNB3p+05VEdA6osQKRNSqLAUPabuBCWhDYmNIQUfhwf0gwaOGnUXPcIwHGWBj2ONw7zsCWTW+DmekELD5K/c5OyabmcKConGC7c14RL5ds= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633168719373354.5224193434816; Sat, 2 Oct 2021 02:58:39 -0700 (PDT) Received: from localhost ([::1]:34038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbmw-0003sg-Bo for importer@patchew.org; Sat, 02 Oct 2021 05:58:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblQ-00016A-WF for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45455) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblN-0004MQ-V0 for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:04 -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-235-Eg_rlWRGMh2c4bWO3pRjrQ-1; Sat, 02 Oct 2021 05:56:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 66C6E1006AA3; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39CBA5C1CF; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 839FB11384A2; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168620; 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=qMfn+KDKDXb3a8VinVn4bpWUD0UAYmWDXtYSpLs+RpI=; b=OP+VxrUKgUWBK1+jH6qjgD++8O9iaVPEln5GmSSFquvMg0srRpb+0KiNq0OJeFzasEysL4 0bBPeZdzN0Wbuu1+JTYB/tbwDCbe1KKqGtErynHLJXhKi3/4e5MxTUtzj3LSrp9s4X6+Hi VgmIYvoRpedAuD4klG/VT2ficm8Ojmc= X-MC-Unique: Eg_rlWRGMh2c4bWO3pRjrQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 07/13] qapi/parser: Introduce NullSection Date: Sat, 2 Oct 2021 11:56:49 +0200 Message-Id: <20211002095655.1944970-8-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633168720249100003 Content-Type: text/plain; charset="utf-8" From: John Snow 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 Message-Id: <20210930205716.1148693-8-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- 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 82f1d952b1..40c5da4b17 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633169230; cv=none; d=zohomail.com; s=zohoarc; b=W2JPp/2Idn10sBhrFxbuKKwt/GYVDckaJKzyF3bI0QydgW2chnjHLv38N3PwJfMDlStrkbJWjXHc9EOcN6UqO6KHVi2CS93+QDErA60KClcW2bo9zc04b9eOXU6tl+vEU/ZsIM0Kpxubs/qo4aachi6KUWXiixQJLa4Yc/nlje0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633169230; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IASMJpbOLDrJKSmCvs08c/4g8E3fz35MmJED/cstpgI=; b=PMSZxFVrHPDsu9AfBWHpaetF+rhlnkx/Hqv1OuCinTKlRLrvyoZTgD0slfO3LadwfUfeDtgRu/HEYUtaNyxxNM3fCbQ816bIRWucBVidl5jrQTfPHVlgNc1F4alcL/fXH3JVC2T3uWiH/4qGLFVVyFA9ro9ZA1r7/dSwVNbN6OA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633169230077952.1238768711024; Sat, 2 Oct 2021 03:07:10 -0700 (PDT) Received: from localhost ([::1]:58952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbv7-0003yC-KR for importer@patchew.org; Sat, 02 Oct 2021 06:07:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblY-00019f-L7 for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblU-0004XT-G6 for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:11 -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-357-xf6HULDvNteEDwX_L6UsmQ-1; Sat, 02 Oct 2021 05:57:03 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 899471006AA4; Sat, 2 Oct 2021 09:57:02 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 397B15DA61; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8705811384A9; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168627; 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=IASMJpbOLDrJKSmCvs08c/4g8E3fz35MmJED/cstpgI=; b=f4rjzkpswYVgulezZoWPKwVZXB2F49Kw7FwsT0Z9/TccdPcQAYGnu/bRLFN6vYLncuYFmx G2gLCA+swXBSlbUgK1uk4ynsQxVmfzDhoBJfcWst+PPm/4sq5fSBKeurpU4fQ9qy+aXgJz XScS4T5NANEBBRs7zwGeWDiRKmCUdIg= X-MC-Unique: xf6HULDvNteEDwX_L6UsmQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 08/13] qapi/parser: add import cycle workaround Date: Sat, 2 Oct 2021 11:56:50 +0200 Message-Id: <20211002095655.1944970-9-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633169231627100001 Content-Type: text/plain; charset="utf-8" From: John Snow 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 Message-Id: <20210930205716.1148693-9-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-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 40c5da4b17..75582ddb00 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633169282; cv=none; d=zohomail.com; s=zohoarc; b=jBwZzTM1RSpiCAYqi3l714IS6Dgv+vH3kfIIPXYhEipSMn5COBcfPQWTvgz4uRZgBlktmq7kNRkgUr+FTi/AHS0v1RCwnNEnD62wNswVdHRGq0KnqZOMzFN6DPI5rsL56gWsApODGZWUac0fgrZ+8l9e7zioSVt4pMJfwEi+lAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633169282; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NDESu8Wm5u/or6VaN3BSkT1a7yudVhFDOUybY1ZWK/w=; b=FN4vcXg07lCozQgT2nqScQrHxK5kfThzdPfijTwpbCVto4uTscb4YLVznkcljE1QEatdVloz/E2tJiFhwD73blo2I6b0AienEPv9cnQLUfb3LGZdJBgNR/EnrRbIPukGNAl7aeDS6qjcHFbY5ToF3X0bowQx4b+ZBToXYDPIaZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633169282585378.280109873432; Sat, 2 Oct 2021 03:08:02 -0700 (PDT) Received: from localhost ([::1]:60930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbw0-0005Gg-5D for importer@patchew.org; Sat, 02 Oct 2021 06:08:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWbla-0001AD-J2 for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45306) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblR-0004VM-Mz for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:12 -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-527-vw4tpHXyNEK1vaaPhTM8zA-1; Sat, 02 Oct 2021 05:56:59 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8EA085074C; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D61E19723; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8A81B1138461; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168625; 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=NDESu8Wm5u/or6VaN3BSkT1a7yudVhFDOUybY1ZWK/w=; b=by3TMeH4kZ7LiTLJ8sAbjUUeYRGiqFbCCmptSxrgbUL6ShvphEei8OuIDKP7Tb/b20yZLk FOgx1dKBC2ZNGHSZOda0LApKGdlCJiSAp+25LTROIxEWz1BpdsGH1hhI4Ut0H6FDA2F1RN ncUFd4/vsweQD0aFWIwT25kqZVTsUs8= X-MC-Unique: vw4tpHXyNEK1vaaPhTM8zA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 09/13] qapi/parser: add type hint annotations (QAPIDoc) Date: Sat, 2 Oct 2021 11:56:51 +0200 Message-Id: <20211002095655.1944970-10-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633169283424100001 Content-Type: text/plain; charset="utf-8" From: John Snow Annotations do not change runtime behavior. This commit consists of only annotations. Signed-off-by: John Snow Message-Id: <20210930205716.1148693-10-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-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 75582ddb00..73c1c4ef59 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633169170; cv=none; d=zohomail.com; s=zohoarc; b=ikSAo7SXvIMN1vsUBBOahoexAboFGjJ33kzOHB9O1NZesYEgj1ITGRPZx6LEkpBmvPhlL7nD6MQBO8uZR6mdfs8RF66ezP7kEBd71XYeZsUvEXHMx88I4U0XTUbUrbseGfp3D4HkbhHgfd2l/MBlpa69dSX37mPbvXomVmgx3yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633169170; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bQbKQBZrFbkbxLwMArF7uiik853Y4FbAwNCHn6ru5t0=; b=QG49RMc1kvROAb8qZXGB6MDk4MCbLaXKFFDp+Wfc4A9SkcOTzeJpBJ+mIcFrj9P1eBGyME0wqMhkNujGKIlGg/mCgCOXGDMj74/eZ3beRWgeV0KbCDsUo0C6iI1xuwf65u45SFBYCEW0ALrbIBJUP+7SAVieyQW8qFkfxg9V0wc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633169170066196.03143347389027; Sat, 2 Oct 2021 03:06:10 -0700 (PDT) Received: from localhost ([::1]:54210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbuC-0000gZ-UR for importer@patchew.org; Sat, 02 Oct 2021 06:06:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblY-00019d-KZ for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblQ-0004SC-MI for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:10 -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-574-HlL55dmiNgeDZHCPT36jpw-1; Sat, 02 Oct 2021 05:56:59 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BC9D800053; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40D2260C81; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8DCAD1138467; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168622; 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=bQbKQBZrFbkbxLwMArF7uiik853Y4FbAwNCHn6ru5t0=; b=CsuwZRuMKZWesgoPZbx7+yZWUjO0wRDRsfQ+U2kT6A+Oax5Q+f8ruhrx/btyFfkNERHI8/ Y4ql024dP2IrGiU6d57bh0QqOPoCSa//LgI2BmdzbYY7oyZVX6chKMb9iqgiB05dIIgyUP bNRA5wS9JjgM9oXYpwAb29ZwFQuihoc= X-MC-Unique: HlL55dmiNgeDZHCPT36jpw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 10/13] qapi/parser: Add FIXME for consolidating JSON-related types Date: Sat, 2 Oct 2021 11:56:52 +0200 Message-Id: <20211002095655.1944970-11-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633169170836100001 Content-Type: text/plain; charset="utf-8" From: John Snow 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 Message-Id: <20210930205716.1148693-11-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-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 73c1c4ef59..0265b47b95 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633168973; cv=none; d=zohomail.com; s=zohoarc; b=Ba8CIIKEkKZ7H1boYWPlHJoxttit4FNAORsyY1l1gprNUeRbHhmM9n2UUamhujsZZHbUYImjZjJXPRp91Koyfqiufd3zpN1OWSK8YZ8L7mlZQW0OKcCbp0hKqodRLowncfoJykYcgV2z6bFISRFYG5ZkhACqlx1mkr1a77yAtXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633168973; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7XHzKA2CTLUHr3dhrrgSVEspESfureMf19CZpwqFzxA=; b=GDZXcvNvDe+qqMFxiVGe+fYeUbk5IDBqVFfPsY5NZWET6Lp7iiByoHr+pRK7k0Me2Ayuhd0kLSvMAYWnMTNL6FHrtG2op4cqR5F+bt8rVjogrBemyTWED8mamB/QZqL9KOU4UjWHNWtnEEwbaHeeSOufEQ/lOPzojaWeU4BoobQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633168973229746.5028238439864; Sat, 2 Oct 2021 03:02:53 -0700 (PDT) Received: from localhost ([::1]:45698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbr2-0003Tt-92 for importer@patchew.org; Sat, 02 Oct 2021 06:02:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblU-00017W-NQ for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblP-0004SD-7J for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:07 -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-232-AHw2LroNP1eSXX_HyzYlMQ-1; Sat, 02 Oct 2021 05:57:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F0DF800053; Sat, 2 Oct 2021 09:57:00 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4481B5F4E7; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 913411138468; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168622; 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=7XHzKA2CTLUHr3dhrrgSVEspESfureMf19CZpwqFzxA=; b=JftkRfa9qvq6aN9puVeaJySSI61Ihck88mhTUdcYzacRogttR2adHRqDPZUb1hs/r6w3ri XGVBoJW6aRwwlXvH7x0nuPDwPUZmqsviet5pC3dlxHvFglfSFuea0iDVwPm7WckWo9Ip5n LDrcaY0WMto0ApcnVY5vV+KoDsQ9sS0= X-MC-Unique: AHw2LroNP1eSXX_HyzYlMQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 11/13] qapi/parser: enable mypy checks Date: Sat, 2 Oct 2021 11:56:53 +0200 Message-Id: <20211002095655.1944970-12-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633168974569100001 Content-Type: text/plain; charset="utf-8" From: John Snow Signed-off-by: John Snow Message-Id: <20210930205716.1148693-12-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/mypy.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini index 54ca4483d6..6625356429 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633168890; cv=none; d=zohomail.com; s=zohoarc; b=Fhfp2VCcnH0naY5EzPU/llsJz2CtMab7WbXZAXROa90y0v6cbpo022zTlHOwU04pxyXrKfDejuvl97TbIrpX7vUUv/cOd2coR0hhn6E+zERYD0BayBmrZjYegz0C+z8PA6GWKlFg5l90+abbnkUlUMBN3nmUk3sOG7Koi4RLn0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633168890; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mPxya/GwezsjBUFS3MoXaKBld+mVWE2AFjBhCgBEpXY=; b=fxkN13nJLRM3FuK2CSzi9sLmn21WyhaK0qZCfanfoCftjSLIbH35bSSUXxivgZXoQS0tU0JL5SR7CwInMwd0RHSH+uYY0vRlwGcHpmdt+sVKC8+hHZUAKuEtUx/7OWaQOIMFnBv/pyBnURHaTEMIZop8LGcOePYPvd1MedYBD5c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633168890798467.5482238396737; Sat, 2 Oct 2021 03:01:30 -0700 (PDT) Received: from localhost ([::1]:42584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbph-00017e-Nf for importer@patchew.org; Sat, 02 Oct 2021 06:01:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblU-00017a-PW for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblQ-0004Sk-LP for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:08 -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-12-OqL5cCvqPESRALHNfSO0tA-1; Sat, 02 Oct 2021 05:56:59 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7345E1084684; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 48562100AE2C; Sat, 2 Oct 2021 09:56:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9488E1138469; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168622; 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=mPxya/GwezsjBUFS3MoXaKBld+mVWE2AFjBhCgBEpXY=; b=BMZo6XnliQPfX0cw15yJfzItS3OIkeG84w3aUutb5fjfdyG0Z1pqKVd5dkv1I+bXMwfaPz 9BvqL7lH/vsKbzxLZE68pZvFUCbe5zxS8b7zzaLlIhOo1xP437j9UFlV6UbVmY1ceprO7N HLC8QPJmO2IV4avi7pleGBxD34CfxH4= X-MC-Unique: OqL5cCvqPESRALHNfSO0tA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 12/13] qapi/parser: Silence too-few-public-methods warning Date: Sat, 2 Oct 2021 11:56:54 +0200 Message-Id: <20211002095655.1944970-13-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633168892952100001 Content-Type: text/plain; charset="utf-8" From: John Snow Eh. Not worth the fuss today. There are bigger fish to fry. Signed-off-by: John Snow Message-Id: <20210930205716.1148693-13-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-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 0265b47b95..1b006cdc13 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 Sun Feb 8 22:17:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633168762; cv=none; d=zohomail.com; s=zohoarc; b=efhcBz+rYo010zJ1ck+e52g6Xr1daUis0bgm4rSP+pcZrnGnrxuD22uEvGOQVpJm/4oeEgrseS8tFBxEPULsUNv+wWxiku826Ci8wf9Z8pXzsBY02U+4fGrP3DqPszzU0m3OBU1mjTfkYAKEKK99rNSx9Y5AgfMcKgE8qNC5RBw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633168762; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7cJL3XYpPQhhvDpQg4gO6ocZD/fqqkItmf07tXVmwak=; b=hT1IuX5/cz8wyhVxXwGhGiV/4uENR8Z2O8ST1S3zIPBNKMR9N7ZLopNNtfKeMyIRPOvTJTUg8tIey8QUtEttV7ogVD6TULFTq5DbAUaCGxTeYzr2YW02AA/26Sm0LNvrT41+a/IqwUCnG3H6l/pSzKuk+hNWwwHSvw+Dt5/Li1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633168762646488.1817224237825; Sat, 2 Oct 2021 02:59:22 -0700 (PDT) Received: from localhost ([::1]:37162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbnd-0005wi-MG for importer@patchew.org; Sat, 02 Oct 2021 05:59:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblU-00017P-Mm for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWblP-0004T0-NY for qemu-devel@nongnu.org; Sat, 02 Oct 2021 05:57:07 -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-531-nqtKQ5NsOtW0wrKXSNXZvg-1; Sat, 02 Oct 2021 05:57:00 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C36B1802928; Sat, 2 Oct 2021 09:56:59 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 977E419723; Sat, 2 Oct 2021 09:56:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 97E0811380A9; Sat, 2 Oct 2021 11:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633168623; 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=7cJL3XYpPQhhvDpQg4gO6ocZD/fqqkItmf07tXVmwak=; b=LxZ1mvJftcCt0iNQipWEgEzi8xZ+PX+4Kh2vI+8P+junu70havATNx8AyQgsUL3EVuoAi+ m8XBf0jg+FkAhw/Y5tf9VqWPcflaP1ym0rhsxD5tLM0QBk9px8tQHKjBRvrstK6PFW3yYc 5wwaae7OQN4D+qJ7WhEWC+/zRKXtWJg= X-MC-Unique: nqtKQ5NsOtW0wrKXSNXZvg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 13/13] qapi/parser: enable pylint checks Date: Sat, 2 Oct 2021 11:56:55 +0200 Message-Id: <20211002095655.1944970-14-armbru@redhat.com> In-Reply-To: <20211002095655.1944970-1-armbru@redhat.com> References: <20211002095655.1944970-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@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: peter.maydell@linaro.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633168763714100001 Content-Type: text/plain; charset="utf-8" From: John Snow Signed-off-by: John Snow Message-Id: <20210930205716.1148693-14-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/pylintrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index 5b7dbc58ad..b259531a72 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