From patchwork Tue Aug 20 00:23:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1974210 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CRdIMNSa; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WnqvN4zvnz1yYZ for ; Tue, 20 Aug 2024 10:23:44 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCes-0005N9-HK; Mon, 19 Aug 2024 20:23:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCeq-0005BZ-DL for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCeo-0003ri-Rw for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uq0gvW6lhA9f5naE5+wCuwIJeRf8GGxda2e3fpP9QGY=; b=CRdIMNSaa+UucIzOgHsCb/LEBchLgrDsyLhRo+eIITAHVbrSOYuCTLhS2cAwiMOAa+P78v PzCzNZBkwTmxqmdaI6iBQgPMP2AT+GCeFK16aNO8Wllev8cN2qigi4V03IqGkwVFBQwLya 0BjUw6Mf3dURAkRfeho86zjrc3o4WyA= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-222-k59HPmzPM6y6AViAG_Jc2w-1; Mon, 19 Aug 2024 20:23:27 -0400 X-MC-Unique: k59HPmzPM6y6AViAG_Jc2w-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E58951955BFA; Tue, 20 Aug 2024 00:23:24 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D5BDE19560A3; Tue, 20 Aug 2024 00:23:21 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/8] python/qapi: correct re.Match type hints for 3.13 Date: Mon, 19 Aug 2024 20:23:10 -0400 Message-ID: <20240820002318.1380276-2-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org typing.Match was removed in Python 3.13, so we need to use re.Match instead. However, Python 3.8 doesn't support using re.Match as a type hint directly, so we need a conditional for now. The import is written oddly so that "Match" is explicitly re-exported for re-use by other modules. mypy will complain otherwise. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé --- scripts/qapi/common.py | 10 +++++++++- scripts/qapi/parser.py | 3 +-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 737b059e629..444b3acf53a 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -12,16 +12,24 @@ # See the COPYING file in the top-level directory. import re +import sys from typing import ( Any, Dict, - Match, Optional, Sequence, Union, ) +if sys.version_info < (3, 9): + # typing.Match was removed in 3.13, + # but it's still a necessity in 3.8. + from typing import \ + Match as Match # pylint: disable=useless-import-alias +else: + Match = re.Match + #: Magic string that gets removed along with all space to its right. EATSPACE = '\033EATSPACE.' POINTER_SUFFIX = ' *' + EATSPACE diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index adc85b5b394..9a42b119131 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -23,13 +23,12 @@ Dict, List, Mapping, - Match, Optional, Set, Union, ) -from .common import must_match +from .common import Match, must_match from .error import QAPISemError, QAPISourceError from .source import QAPISourceInfo From patchwork Tue Aug 20 00:23:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1974212 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BNax4JqF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wnqw236k4z1yYZ for ; Tue, 20 Aug 2024 10:24:18 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCf8-0006JT-2a; Mon, 19 Aug 2024 20:23:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCet-0005Rr-Im for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCer-0003ry-V5 for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6rWo2Tsdw7qt5kSlRzu/xbKB78mSUh/D6zkAbI38l4s=; b=BNax4JqFz8wqJe53gJBW5iUnJGF7+imIPhPuRCPK6rwxbnb6TcRFGSTbutc0HqvLXQeRFd p7WtkSSipCPsn+eNfzzsNLa1zMhjUdFbyJU4N37tfzP8hejji+E8s2EDX1VDltoHd6B9oQ +3JyRe1OmamzDrxP06BebHayumM+71Q= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-SLZIk3gnN26nbTu1MhNmzw-1; Mon, 19 Aug 2024 20:23:29 -0400 X-MC-Unique: SLZIk3gnN26nbTu1MhNmzw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DEBA419560B4; Tue, 20 Aug 2024 00:23:27 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5E87E1956053; Tue, 20 Aug 2024 00:23:25 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/8] python/qapi: change "FIXME" to "TODO" Date: Mon, 19 Aug 2024 20:23:11 -0400 Message-ID: <20240820002318.1380276-3-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org qemu.git/python/setup.cfg disallows checking in any code with "XXX", "FIXME" or "TODO" in the comments. Soften the restriction to only prohibit "FIXME", and change the two occurrences of "FIXME" in qapi to read "TODO" instead. Signed-off-by: John Snow --- python/setup.cfg | 5 +++++ scripts/qapi/commands.py | 2 +- scripts/qapi/events.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/setup.cfg b/python/setup.cfg index 3b4e2cc5501..72b58c98c99 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -169,6 +169,11 @@ ignore-signatures=yes # TODO: Remove after we opt in to Pylint 2.8.3. See commit msg. min-similarity-lines=6 +[pylint.miscellaneous] + +# forbid FIXME/XXX comments, allow TODO. +notes=FIXME, + XXX, [isort] force_grid_wrap=4 diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 79951a841f5..cffed6cd3ba 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -385,7 +385,7 @@ def visit_command(self, coroutine: bool) -> None: if not gen: return - # FIXME: If T is a user-defined type, the user is responsible + # TODO: If T is a user-defined type, the user is responsible # for making this work, i.e. to make T's condition the # conjunction of the T-returning commands' conditions. If T # is a built-in type, this isn't possible: the diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index d1f639981a9..36dc0c50c78 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -84,7 +84,7 @@ def gen_event_send(name: str, boxed: bool, event_enum_name: str, event_emit: str) -> str: - # FIXME: Our declaration of local variables (and of 'errp' in the + # TODO: Our declaration of local variables (and of 'errp' in the # parameter list) can collide with exploded members of the event's # data type passed in as parameters. If this collision ever hits in # practice, we can rename our local variables with a leading _ prefix, From patchwork Tue Aug 20 00:23:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1974217 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ScEm9opQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wnqwq3YqHz1yYZ for ; Tue, 20 Aug 2024 10:24:59 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfE-000759-GG; Mon, 19 Aug 2024 20:23:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCev-0005Z0-7I for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCet-0003s6-K2 for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ChOcyKM7vxrJog08lbTCt4LwIxuTF65PtkjUT+QeaE=; b=ScEm9opQqgoGAohmmBAUVvdi8xi0LunG2k2uC1QpE4IksCLy/WBF41jx3oYFr5VpzkQjL2 rUmtuNSlF6XniGwNf8jmTEMCQEeufMQGPO/qNAcn6tUVa7kTvQD+ZfhJlCoOohMg5mrlpE cjo6SVtr+RuPA8RKOjnBFKAUw2NKJFQ= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-KrQ78QTtNgGL6n0865yFhA-1; Mon, 19 Aug 2024 20:23:31 -0400 X-MC-Unique: KrQ78QTtNgGL6n0865yFhA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8C611955D57; Tue, 20 Aug 2024 00:23:30 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 12E0F1955F44; Tue, 20 Aug 2024 00:23:27 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/8] python/qapi: add pylint pragmas Date: Mon, 19 Aug 2024 20:23:12 -0400 Message-ID: <20240820002318.1380276-4-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We are preparing to move the QAPI generator code into qemu.git/python/qemu/qapi. The qemu.git/python pylint configuration is stricter than the current qapi generator configuration. These additional pragmas bridge the gap without requiring us to loosen the requirements in the python directory. Signed-off-by: John Snow --- scripts/qapi/expr.py | 1 + scripts/qapi/introspect.py | 1 + scripts/qapi/parser.py | 4 ++++ scripts/qapi/visit.py | 1 + 4 files changed, 7 insertions(+) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index cae0a083591..f60e580dd36 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -604,6 +604,7 @@ def check_exprs(exprs: List[QAPIExpression]) -> List[QAPIExpression]: :raise QAPISemError: When any expression fails validation. :return: The same list of expressions (now modified). """ + # pylint: disable=too-many-branches for expr in exprs: info = expr.info doc = expr.doc diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index ac14b20f308..9d499f90b7c 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -106,6 +106,7 @@ def _tree_to_qlit(obj: JSONValue, :param dict_value: True when the value being processed belongs to a dict key; which suppresses the output indent. """ + # pylint: disable=too-many-branches def indent(level: int) -> str: return level * 4 * ' ' diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 9a42b119131..9bb039fe8d3 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -118,6 +118,8 @@ def _parse(self) -> None: :return: None. Results are stored in ``.exprs`` and ``.docs``. """ + # pylint: disable=too-many-branches + cur_doc = None # May raise OSError; allow the caller to handle it. @@ -290,6 +292,7 @@ def accept(self, skip_comment: bool = True) -> None: ``.tok`` and ``.val`` will both be None at EOF. """ + # pylint: disable=too-many-branches while True: self.tok = self.src[self.cursor] self.pos = self.cursor @@ -478,6 +481,7 @@ def get_doc_paragraph(self, doc: 'QAPIDoc') -> Optional[str]: doc.append_line(line) def get_doc(self) -> 'QAPIDoc': + # pylint: disable=too-many-statements,too-many-branches if self.val != '##': raise QAPIParseError( self, "junk after '##' at start of documentation comment") diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index 12f92e429f6..20ce6be9978 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -65,6 +65,7 @@ def gen_visit_object_members(name: str, base: Optional[QAPISchemaObjectType], members: List[QAPISchemaObjectTypeMember], branches: Optional[QAPISchemaBranches]) -> str: + # pylint: disable=too-many-branches ret = mcgen(''' bool visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp) From patchwork Tue Aug 20 00:23:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1974216 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=O0HCuzcT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wnqwl0v7Xz1yYZ for ; Tue, 20 Aug 2024 10:24:55 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfI-0007Tp-9Y; Mon, 19 Aug 2024 20:24:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCew-0005e9-JO for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCev-0003sK-69 for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rzVIR2iKYmZ0GMgj8OYgVR574tB9UHe4tLCIQsBzX3Q=; b=O0HCuzcTMilVFYKmuynJWr2oen2QxoASR4WJoeQeReXgpOEtr7Hr8+KYE+49bDMhKgWMJg XArXDtRHhcYg0oQqjg7UQSujPcG1EO8f+9onsg2f9fNSFdVmh4b4Ebs6URDDw9yhfPjU2G 8F1W4CExZnj8zCxIEAD7vAjbPKy1X7E= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-508-2qYrD8taMsCQUBAPOca5AQ-1; Mon, 19 Aug 2024 20:23:34 -0400 X-MC-Unique: 2qYrD8taMsCQUBAPOca5AQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2908D1955BFE; Tue, 20 Aug 2024 00:23:33 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CF35C1955F45; Tue, 20 Aug 2024 00:23:30 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/8] python/qapi: remove outdated pragmas Date: Mon, 19 Aug 2024 20:23:13 -0400 Message-ID: <20240820002318.1380276-5-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org These pragmas are no longer neccessary under our current linter/static analysis versions; they can be removed. Signed-off-by: John Snow --- scripts/qapi/gen.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 6a8abe00415..ce94aee8e70 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -62,11 +62,9 @@ def get_content(self) -> str: return self._top() + self._preamble + self._body + self._bottom() def _top(self) -> str: - # pylint: disable=no-self-use return '' def _bottom(self) -> str: - # pylint: disable=no-self-use return '' def write(self, output_dir: str) -> None: From patchwork Tue Aug 20 00:23:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1974214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VXA8ImMd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wnqw35K5rz1yYZ for ; Tue, 20 Aug 2024 10:24:19 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfC-0006op-K4; Mon, 19 Aug 2024 20:23:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf1-0005y9-Ad for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCez-0003sp-CW for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bihOoSkwA1O6zLvD7UvAJE+9N3HlxTZKpPu6NWV7caA=; b=VXA8ImMdkrwEeeNTvjKiXYcZ8/Y9F6C2KP6BexcYcxCcxcNg72/UZNgUM2JUB6F3dpzkV+ E8wbkFXstCZtPInaTOGEjIROc33q+rKQ4kt1kvTVBkKlkE//XhKH+unDXZ/Js73qCcnYDj 05Vx2ja7GZmtIeo8f2jlB4qvOjKDm9Q= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-581-fABkUriQPhi2uGZXnJIoKg-1; Mon, 19 Aug 2024 20:23:36 -0400 X-MC-Unique: fABkUriQPhi2uGZXnJIoKg-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 967191954B23; Tue, 20 Aug 2024 00:23:35 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3333419560A3; Tue, 20 Aug 2024 00:23:33 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/8] python/qapi: ignore missing docstrings in pylint Date: Mon, 19 Aug 2024 20:23:14 -0400 Message-ID: <20240820002318.1380276-6-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Maybe temporary, I am not sure. Instead of disabling docstring checking *globally* for all of our python files, just disable it for QAPI modules. Signed-off-by: John Snow --- scripts/qapi/commands.py | 2 ++ scripts/qapi/common.py | 2 ++ scripts/qapi/events.py | 2 ++ scripts/qapi/expr.py | 2 ++ scripts/qapi/gen.py | 2 ++ scripts/qapi/introspect.py | 2 ++ scripts/qapi/main.py | 2 ++ scripts/qapi/parser.py | 2 ++ scripts/qapi/schema.py | 2 +- scripts/qapi/source.py | 2 ++ scripts/qapi/types.py | 2 ++ scripts/qapi/visit.py | 2 ++ 12 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index cffed6cd3ba..b01de93c965 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -13,6 +13,8 @@ See the COPYING file in the top-level directory. """ +# pylint: disable=missing-docstring + from typing import ( Dict, List, diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 444b3acf53a..918a1ab728a 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -11,6 +11,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. +# pylint: disable=missing-docstring + import re import sys from typing import ( diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index 36dc0c50c78..9ab9ff4e695 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -12,6 +12,8 @@ See the COPYING file in the top-level directory. """ +# pylint: disable=missing-docstring + from typing import List, Optional from .common import c_enum_const, c_name, mcgen diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index f60e580dd36..c137dcf950a 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -13,6 +13,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. +# pylint: disable=missing-docstring + """ Normalize and validate (context-free) QAPI schema expression structures. diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index ce94aee8e70..f869c751e53 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -11,6 +11,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. +# pylint: disable=missing-docstring + from contextlib import contextmanager import os import re diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 9d499f90b7c..44edc42d18b 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -11,6 +11,8 @@ See the COPYING file in the top-level directory. """ +# pylint: disable=missing-docstring + from typing import ( Any, Dict, diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py index 316736b6a29..24ffa15aa2c 100644 --- a/scripts/qapi/main.py +++ b/scripts/qapi/main.py @@ -7,6 +7,8 @@ This is the main entry point for generating C code from the QAPI schema. """ +# pylint: disable=missing-docstring + import argparse import sys from typing import Optional diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 9bb039fe8d3..9113c9d1506 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -14,6 +14,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. +# pylint: disable=missing-docstring + from collections import OrderedDict import os import re diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index d65c35f6ee6..a06b3e30ffd 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -12,7 +12,7 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines, missing-docstring # TODO catching name collisions in generated code would be nice diff --git a/scripts/qapi/source.py b/scripts/qapi/source.py index 7b379fdc925..ad7f4e1a0e5 100644 --- a/scripts/qapi/source.py +++ b/scripts/qapi/source.py @@ -9,6 +9,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. +# pylint: disable=missing-docstring + import copy from typing import List, Optional, TypeVar diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py index 0dd0b00ada3..abba5983870 100644 --- a/scripts/qapi/types.py +++ b/scripts/qapi/types.py @@ -13,6 +13,8 @@ # See the COPYING file in the top-level directory. """ +# pylint: disable=missing-docstring + from typing import List, Optional from .common import c_enum_const, c_name, mcgen diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index 20ce6be9978..851f3b01e97 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -13,6 +13,8 @@ See the COPYING file in the top-level directory. """ +# pylint: disable=missing-docstring + from typing import List, Optional from .common import ( From patchwork Tue Aug 20 00:23:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1974213 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eoO5OvX+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wnqw24wjSz1yfg for ; Tue, 20 Aug 2024 10:24:18 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfF-0007F1-RL; Mon, 19 Aug 2024 20:23:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf2-00062k-Gu for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf0-0003tG-Jb for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+BWut0oMwogFBURxJ7pVFl65sLZ5cIGHleFZfkcXaHk=; b=eoO5OvX+xE0RRWIQvO+pXmjmTd0j+3m0xpAywJ7y8wpctfXkgnBn0/RZXB7Q+xvmk1YJqW 0gW7y9shWjRtWFqnGtBt16eZAFeu2EMvHDqMeDX3lLEACUhzCSSqZAtsMRcMsQacjr97Q/ wE8/74I8smh8fmja5XejTFKpfZw6xhs= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-119-TxBZQL6uMXO8wIz1apXwKQ-1; Mon, 19 Aug 2024 20:23:39 -0400 X-MC-Unique: TxBZQL6uMXO8wIz1apXwKQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 145261955D57; Tue, 20 Aug 2024 00:23:38 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8034A1956053; Tue, 20 Aug 2024 00:23:35 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 6/8] python: allow short names for variables on older pylint Date: Mon, 19 Aug 2024 20:23:15 -0400 Message-ID: <20240820002318.1380276-7-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Pylint >= 3.0.0 disabled this feature, but older pylint does not: allow short names by default by using a regex to do so. Incidentally, this removes the need for most of the allow list we had before, so remove most of that, too. Signed-off-by: John Snow --- python/setup.cfg | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/python/setup.cfg b/python/setup.cfg index 72b58c98c99..58dba90f815 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -148,17 +148,11 @@ disable=consider-using-f-string, [pylint.basic] # Good variable names which should always be accepted, separated by a comma. -good-names=i, - j, - k, - ex, - Run, - _, # By convention: Unused variable - fh, # fh = open(...) - fd, # fd = os.open(...) - c, # for c in string: ... - T, # for TypeVars. See pylint#3401 - SocketAddrT, # Not sure why this is invalid. +good-names=SocketAddrT, # Not sure why this is invalid. + +# pylint < 3.0 warns by default on short variable names. +# Disable this for older versions. +good-names-rgxs=^[_a-z][_a-z0-9]?$ [pylint.similarities] # Ignore imports when computing similarities. From patchwork Tue Aug 20 00:23:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1974218 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DTl3J7Gn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wnqx30dSVz1yXf for ; Tue, 20 Aug 2024 10:25:11 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfE-000757-G2; Mon, 19 Aug 2024 20:23:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf4-0006CJ-Ng for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf2-0003ts-9b for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3DRnrN6I6/B7gYk188UkJV+Z825z6apeSX/OAnvW++I=; b=DTl3J7Gn7fWO2a01AH9cFvRF7aXQJhY0QzKwpPLPeVhXCtOuchj9vYqdRQFCOL4gg3sj1n I94qA0Oq1F2Xf2Nntp3k1b12o6quLWEGFpDWE0fceP6DNQbjglTR22tfHSRw9S74RsLLyO H6ucEJkaAH6dWjwB7cgdpumbbCCaQow= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-287-HtTdzgVUMM-nzQUAOiZPsQ-1; Mon, 19 Aug 2024 20:23:41 -0400 X-MC-Unique: HtTdzgVUMM-nzQUAOiZPsQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6397D1954B1F; Tue, 20 Aug 2024 00:23:40 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1A95519560A3; Tue, 20 Aug 2024 00:23:37 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 7/8] python/qapi: move scripts/qapi to python/qemu/qapi Date: Mon, 19 Aug 2024 20:23:16 -0400 Message-ID: <20240820002318.1380276-8-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This is being done for the sake of unifying the linting and static type analysis configurations between scripts/qapi and python/qemu/*. With this change, the qapi module will now be checked by mypy, flake8, pylint, isort etc under all python versions from 3.8 through 3.13 under a variety of different dependency configurations in the GitLab testing pipelines. The tests can be run locally, as always: > cd qemu.git/python > make check-minreqs > make check-tox > make check-dev "check-minreqs" is the must-pass GitLab test. "check-tox" is the optional allowed-to-fail GitLab test. Signed-off-by: John Snow --- MAINTAINERS | 2 +- docs/conf.py | 2 +- docs/sphinx/qapidoc.py | 6 ++--- meson.build | 28 ++++++++++----------- {scripts => python/qemu}/qapi/.flake8 | 0 {scripts => python/qemu}/qapi/.isort.cfg | 0 {scripts => python/qemu}/qapi/__init__.py | 0 {scripts => python/qemu}/qapi/commands.py | 0 {scripts => python/qemu}/qapi/common.py | 0 {scripts => python/qemu}/qapi/error.py | 0 {scripts => python/qemu}/qapi/events.py | 0 {scripts => python/qemu}/qapi/expr.py | 0 {scripts => python/qemu}/qapi/gen.py | 0 {scripts => python/qemu}/qapi/introspect.py | 0 {scripts => python/qemu}/qapi/main.py | 0 {scripts => python/qemu}/qapi/mypy.ini | 0 {scripts => python/qemu}/qapi/parser.py | 0 {scripts => python/qemu}/qapi/pylintrc | 0 {scripts => python/qemu}/qapi/schema.py | 0 {scripts => python/qemu}/qapi/source.py | 0 {scripts => python/qemu}/qapi/types.py | 0 {scripts => python/qemu}/qapi/visit.py | 0 python/setup.cfg | 1 + scripts/qapi-gen.py | 4 ++- tests/qapi-schema/meson.build | 2 +- tests/qapi-schema/test-qapi.py | 4 +-- 26 files changed, 26 insertions(+), 23 deletions(-) rename {scripts => python/qemu}/qapi/.flake8 (100%) rename {scripts => python/qemu}/qapi/.isort.cfg (100%) rename {scripts => python/qemu}/qapi/__init__.py (100%) rename {scripts => python/qemu}/qapi/commands.py (100%) rename {scripts => python/qemu}/qapi/common.py (100%) rename {scripts => python/qemu}/qapi/error.py (100%) rename {scripts => python/qemu}/qapi/events.py (100%) rename {scripts => python/qemu}/qapi/expr.py (100%) rename {scripts => python/qemu}/qapi/gen.py (100%) rename {scripts => python/qemu}/qapi/introspect.py (100%) rename {scripts => python/qemu}/qapi/main.py (100%) rename {scripts => python/qemu}/qapi/mypy.ini (100%) rename {scripts => python/qemu}/qapi/parser.py (100%) rename {scripts => python/qemu}/qapi/pylintrc (100%) rename {scripts => python/qemu}/qapi/schema.py (100%) rename {scripts => python/qemu}/qapi/source.py (100%) rename {scripts => python/qemu}/qapi/types.py (100%) rename {scripts => python/qemu}/qapi/visit.py (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 3584d6a6c6d..1912940631d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3214,7 +3214,7 @@ F: tests/unit/test-qapi-*.c F: tests/unit/test-qmp-*.c F: tests/unit/test-visitor-serialization.c F: scripts/qapi-gen.py -F: scripts/qapi/* +F: python/qemu/qapi/* F: docs/sphinx/qapidoc.py F: docs/devel/qapi* T: git https://repo.or.cz/qemu/armbru.git qapi-next diff --git a/docs/conf.py b/docs/conf.py index 876f6768815..6600db976b3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,7 +46,7 @@ # Our extensions are in docs/sphinx; the qapidoc extension requires # the QAPI modules from scripts/. sys.path.insert(0, os.path.join(qemu_docdir, "sphinx")) -sys.path.insert(0, os.path.join(qemu_docdir, "../scripts")) +sys.path.insert(0, os.path.join(qemu_docdir, "../python")) # -- General configuration ------------------------------------------------ diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index 738b2450fb1..777fd1ac836 100644 --- a/docs/sphinx/qapidoc.py +++ b/docs/sphinx/qapidoc.py @@ -33,9 +33,9 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from docutils.statemachine import ViewList -from qapi.error import QAPIError, QAPISemError -from qapi.gen import QAPISchemaVisitor -from qapi.schema import QAPISchema +from qemu.qapi.error import QAPIError, QAPISemError +from qemu.qapi.gen import QAPISchemaVisitor +from qemu.qapi.schema import QAPISchema from sphinx import addnodes from sphinx.directives.code import CodeBlock diff --git a/meson.build b/meson.build index fbda17c987e..f96c9bebe0c 100644 --- a/meson.build +++ b/meson.build @@ -3274,20 +3274,20 @@ genh += configure_file(output: 'config-host.h', configuration: config_host_data) hxtool = find_program('scripts/hxtool') shaderinclude = find_program('scripts/shaderinclude.py') qapi_gen = find_program('scripts/qapi-gen.py') -qapi_gen_depends = [ meson.current_source_dir() / 'scripts/qapi/__init__.py', - meson.current_source_dir() / 'scripts/qapi/commands.py', - meson.current_source_dir() / 'scripts/qapi/common.py', - meson.current_source_dir() / 'scripts/qapi/error.py', - meson.current_source_dir() / 'scripts/qapi/events.py', - meson.current_source_dir() / 'scripts/qapi/expr.py', - meson.current_source_dir() / 'scripts/qapi/gen.py', - meson.current_source_dir() / 'scripts/qapi/introspect.py', - meson.current_source_dir() / 'scripts/qapi/main.py', - meson.current_source_dir() / 'scripts/qapi/parser.py', - meson.current_source_dir() / 'scripts/qapi/schema.py', - meson.current_source_dir() / 'scripts/qapi/source.py', - meson.current_source_dir() / 'scripts/qapi/types.py', - meson.current_source_dir() / 'scripts/qapi/visit.py', +qapi_gen_depends = [ meson.current_source_dir() / 'python/qemu/qapi/__init__.py', + meson.current_source_dir() / 'python/qemu/qapi/commands.py', + meson.current_source_dir() / 'python/qemu/qapi/common.py', + meson.current_source_dir() / 'python/qemu/qapi/error.py', + meson.current_source_dir() / 'python/qemu/qapi/events.py', + meson.current_source_dir() / 'python/qemu/qapi/expr.py', + meson.current_source_dir() / 'python/qemu/qapi/gen.py', + meson.current_source_dir() / 'python/qemu/qapi/introspect.py', + meson.current_source_dir() / 'python/qemu/qapi/main.py', + meson.current_source_dir() / 'python/qemu/qapi/parser.py', + meson.current_source_dir() / 'python/qemu/qapi/schema.py', + meson.current_source_dir() / 'python/qemu/qapi/source.py', + meson.current_source_dir() / 'python/qemu/qapi/types.py', + meson.current_source_dir() / 'python/qemu/qapi/visit.py', meson.current_source_dir() / 'scripts/qapi-gen.py' ] diff --git a/scripts/qapi/.flake8 b/python/qemu/qapi/.flake8 similarity index 100% rename from scripts/qapi/.flake8 rename to python/qemu/qapi/.flake8 diff --git a/scripts/qapi/.isort.cfg b/python/qemu/qapi/.isort.cfg similarity index 100% rename from scripts/qapi/.isort.cfg rename to python/qemu/qapi/.isort.cfg diff --git a/scripts/qapi/__init__.py b/python/qemu/qapi/__init__.py similarity index 100% rename from scripts/qapi/__init__.py rename to python/qemu/qapi/__init__.py diff --git a/scripts/qapi/commands.py b/python/qemu/qapi/commands.py similarity index 100% rename from scripts/qapi/commands.py rename to python/qemu/qapi/commands.py diff --git a/scripts/qapi/common.py b/python/qemu/qapi/common.py similarity index 100% rename from scripts/qapi/common.py rename to python/qemu/qapi/common.py diff --git a/scripts/qapi/error.py b/python/qemu/qapi/error.py similarity index 100% rename from scripts/qapi/error.py rename to python/qemu/qapi/error.py diff --git a/scripts/qapi/events.py b/python/qemu/qapi/events.py similarity index 100% rename from scripts/qapi/events.py rename to python/qemu/qapi/events.py diff --git a/scripts/qapi/expr.py b/python/qemu/qapi/expr.py similarity index 100% rename from scripts/qapi/expr.py rename to python/qemu/qapi/expr.py diff --git a/scripts/qapi/gen.py b/python/qemu/qapi/gen.py similarity index 100% rename from scripts/qapi/gen.py rename to python/qemu/qapi/gen.py diff --git a/scripts/qapi/introspect.py b/python/qemu/qapi/introspect.py similarity index 100% rename from scripts/qapi/introspect.py rename to python/qemu/qapi/introspect.py diff --git a/scripts/qapi/main.py b/python/qemu/qapi/main.py similarity index 100% rename from scripts/qapi/main.py rename to python/qemu/qapi/main.py diff --git a/scripts/qapi/mypy.ini b/python/qemu/qapi/mypy.ini similarity index 100% rename from scripts/qapi/mypy.ini rename to python/qemu/qapi/mypy.ini diff --git a/scripts/qapi/parser.py b/python/qemu/qapi/parser.py similarity index 100% rename from scripts/qapi/parser.py rename to python/qemu/qapi/parser.py diff --git a/scripts/qapi/pylintrc b/python/qemu/qapi/pylintrc similarity index 100% rename from scripts/qapi/pylintrc rename to python/qemu/qapi/pylintrc diff --git a/scripts/qapi/schema.py b/python/qemu/qapi/schema.py similarity index 100% rename from scripts/qapi/schema.py rename to python/qemu/qapi/schema.py diff --git a/scripts/qapi/source.py b/python/qemu/qapi/source.py similarity index 100% rename from scripts/qapi/source.py rename to python/qemu/qapi/source.py diff --git a/scripts/qapi/types.py b/python/qemu/qapi/types.py similarity index 100% rename from scripts/qapi/types.py rename to python/qemu/qapi/types.py diff --git a/scripts/qapi/visit.py b/python/qemu/qapi/visit.py similarity index 100% rename from scripts/qapi/visit.py rename to python/qemu/qapi/visit.py diff --git a/python/setup.cfg b/python/setup.cfg index 58dba90f815..d1582f74ddd 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -28,6 +28,7 @@ packages = qemu.qmp qemu.machine qemu.utils + qemu.qapi [options.package_data] * = py.typed diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py index f3518d29a54..42912c91716 100644 --- a/scripts/qapi-gen.py +++ b/scripts/qapi-gen.py @@ -11,9 +11,11 @@ execution environment. """ +import os import sys -from qapi import main +sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python')) +from qemu.qapi import main if __name__ == '__main__': sys.exit(main.main()) diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index 0f479d93170..080444d0cd4 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -1,5 +1,5 @@ test_env = environment() -test_env.set('PYTHONPATH', meson.project_source_root() / 'scripts') +test_env.set('PYTHONPATH', meson.project_source_root() / 'python') test_env.set('PYTHONIOENCODING', 'utf-8') schemas = [ diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index 7e3f9f4aa1f..dcc0d949971 100755 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -18,8 +18,8 @@ import sys from io import StringIO -from qapi.error import QAPIError -from qapi.schema import QAPISchema, QAPISchemaVisitor +from qemu.qapi.error import QAPIError +from qemu.qapi.schema import QAPISchema, QAPISchemaVisitor class QAPISchemaTestVisitor(QAPISchemaVisitor): From patchwork Tue Aug 20 00:23:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1974215 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HiZw/MLu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wnqw66mkbz1yYZ for ; Tue, 20 Aug 2024 10:24:22 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfG-0007M6-UB; Mon, 19 Aug 2024 20:23:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf7-0006RI-Nq for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf6-0003vQ-49 for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=djrLVOxNjhTkJaYMvjaJgjyI+LpTJmogtLtfxxjcqvM=; b=HiZw/MLuvKbiylymC74TbYFrxD1xpQBFW/C+pih6LxKvjT8nFlkPFgrhDF8v9D3b6thslt KdpZXDFBX+SoVZa8d/npoZohQd85p9l4FuvB2C19EPp8Wj2SrKiwfVWVxOztVEg9sy0XTN Ut7Omy6z5vTFAuiXtccGjouuQ8kl4Oo= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-68-EGIJiM86MamjCYN6V2OjaQ-1; Mon, 19 Aug 2024 20:23:43 -0400 X-MC-Unique: EGIJiM86MamjCYN6V2OjaQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AB6A01955D54; Tue, 20 Aug 2024 00:23:42 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 880FA19560A3; Tue, 20 Aug 2024 00:23:40 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 8/8] python/qapi: remove redundant linter configuration Date: Mon, 19 Aug 2024 20:23:17 -0400 Message-ID: <20240820002318.1380276-9-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Now that the qemu.qapi module is checked by the standard python tests, we don't need separate configuration for it anymore. Signed-off-by: John Snow --- python/qemu/qapi/.flake8 | 3 -- python/qemu/qapi/.isort.cfg | 7 ----- python/qemu/qapi/mypy.ini | 4 --- python/qemu/qapi/pylintrc | 61 ------------------------------------- 4 files changed, 75 deletions(-) delete mode 100644 python/qemu/qapi/.flake8 delete mode 100644 python/qemu/qapi/.isort.cfg delete mode 100644 python/qemu/qapi/mypy.ini delete mode 100644 python/qemu/qapi/pylintrc diff --git a/python/qemu/qapi/.flake8 b/python/qemu/qapi/.flake8 deleted file mode 100644 index a873ff67309..00000000000 --- a/python/qemu/qapi/.flake8 +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -# Prefer pylint's bare-except checks to flake8's -extend-ignore = E722 diff --git a/python/qemu/qapi/.isort.cfg b/python/qemu/qapi/.isort.cfg deleted file mode 100644 index 643caa1fbd6..00000000000 --- a/python/qemu/qapi/.isort.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[settings] -force_grid_wrap=4 -force_sort_within_sections=True -include_trailing_comma=True -line_length=72 -lines_after_imports=2 -multi_line_output=3 diff --git a/python/qemu/qapi/mypy.ini b/python/qemu/qapi/mypy.ini deleted file mode 100644 index 8109470a031..00000000000 --- a/python/qemu/qapi/mypy.ini +++ /dev/null @@ -1,4 +0,0 @@ -[mypy] -strict = True -disallow_untyped_calls = False -python_version = 3.8 diff --git a/python/qemu/qapi/pylintrc b/python/qemu/qapi/pylintrc deleted file mode 100644 index c028a1f9f51..00000000000 --- a/python/qemu/qapi/pylintrc +++ /dev/null @@ -1,61 +0,0 @@ -[MASTER] - -[MESSAGES CONTROL] - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once). You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use "--disable=all --enable=classes -# --disable=W". -disable=consider-using-f-string, - fixme, - missing-docstring, - too-many-arguments, - too-many-branches, - too-many-instance-attributes, - too-many-statements, - useless-option-value, - -[REPORTS] - -[REFACTORING] - -[MISCELLANEOUS] - -[LOGGING] - -[BASIC] - -# Good variable names regexes, separated by a comma. If names match any regex, -# they will always be accepted. -# -# Suppress complaints about short names. PEP-8 is cool with them, -# and so are we. -good-names-rgxs=^[_a-z][_a-z0-9]?$ - -[VARIABLES] - -[STRING] - -[SPELLING] - -[FORMAT] - -[SIMILARITIES] - -# Ignore import statements themselves when computing similarities. -ignore-imports=yes - -[TYPECHECK] - -[CLASSES] - -[IMPORTS] - -[DESIGN] - -[EXCEPTIONS]