From nobody Wed May 15 10:23:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453618; cv=none; d=zohomail.com; s=zohoarc; b=Zei9qBcm7fKyaOpCjjHPioFYc0PM7NHIiS2GTeU3MkLwWxaor3LyakUP/8aG74eAxTlXFJZlPPjWz4l7Cr1aote1g3o9MKg3TxxJMrZrizksUtrr+JeENt/9P7JM8T6wK/TMkETpWfGOrjFhf3/dZmScEXQsBXjgH6zF5l6nYn0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453618; 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=4i+hmM0yc57nREUGRC6gdQr0AqqnEdtHZHWqTtPjb8I=; b=P7objz3zigIG8iYA7eLUEs79jZK/x0RiXj2Htfzyt+/bdCBWP/GopTQeFOksfm7SevaUjwiqarUGv3oEbs2BCbgTcnAS+AAffDWgETef1O0N65jiqdJl617Mly1YZftm+B1KEGeKvmGK1hSx7Yx70Hp8HQc9B6qlh73PxP7hFbw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621453618633373.106497105309; Wed, 19 May 2021 12:46:58 -0700 (PDT) Received: from localhost ([::1]:37378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS9h-0000gq-M1 for importer@patchew.org; Wed, 19 May 2021 15:46:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRhB-0001Of-Cr for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRh8-0005S7-Kr for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:29 -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-492-5MLLTTBsPb-Pyx475zwCYg-1; Wed, 19 May 2021 15:17:21 -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 18B7C801106; Wed, 19 May 2021 19:17:21 +0000 (UTC) Received: from scv.redhat.com (ovpn-117-64.rdu2.redhat.com [10.10.117.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BA845D9CC; Wed, 19 May 2021 19:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621451846; 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=4i+hmM0yc57nREUGRC6gdQr0AqqnEdtHZHWqTtPjb8I=; b=bHn/6uOvE35MA9C8ZkmjjcwulhMB56BNbxyFZB8e206nfgsMG5N5gVmWFAhDJp3fAiGJUK hkwAbptVKy238JdQRBP/241QAEioxV8SQFRhXUsex4EPYEQK+PIFcftXbtKz/THDm/IqIe JZriNSOb6DAiiH1gsYLlHxU5VAXTlFc= X-MC-Unique: 5MLLTTBsPb-Pyx475zwCYg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 1/6] qapi/parser.py: remove unused check_args_section arguments Date: Wed, 19 May 2021 15:17:13 -0400 Message-Id: <20210519191718.3950330-2-jsnow@redhat.com> In-Reply-To: <20210519191718.3950330-1-jsnow@redhat.com> References: <20210519191718.3950330-1-jsnow@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=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" (Addresses a pylint warning.) Signed-off-by: John Snow --- scripts/qapi/parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 06167ed3e0a..b3a468504fc 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -753,7 +753,7 @@ def check_expr(self, expr): =20 def check(self): =20 - def check_args_section(args, info, what): + def check_args_section(args): bogus =3D [name for name, section in args.items() if not section.member] if bogus: @@ -764,5 +764,5 @@ def check_args_section(args, info, what): "', '".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) + check_args_section(self.features) --=20 2.30.2 From nobody Wed May 15 10:23:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453124; cv=none; d=zohomail.com; s=zohoarc; b=SwiYJ1yLIevao8NjavnOWuLY+4e6lVabgwTmDr2nmq9Jv+g0SMYcecZlsP1KE+PJGBRUY5Vm+ayT0wa1YtfF/ij1ffIwKHbhWgK/KiCQNvzU7o5rA58bVyY5+HE5BltehVsFVcGqY9IbcF2y0pc7NKqLkyTobji5XBnsF3/1ipY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453124; 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=uF/EpQitQKNkZn1ZK7H/xxOUXchsklFRlM+Lhot5zdA=; b=baEcl9/7oaEQute6u8SmgV94/bSMzALSKVAs3dMAcRWtHQZhSXuBT2Q/fNzQ9P48G8WJvMnparO+F9MyomaQWp2DP5WGRiF+FLAeH08iGEggrMhX5fK3+gvcprY/U834ePG+VFM9dFoa8MZnFyjducBkY2fhvsyTE67bCU4E/gY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621453124024461.79853835805045; Wed, 19 May 2021 12:38:44 -0700 (PDT) Received: from localhost ([::1]:41926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS1j-0001TM-1y for importer@patchew.org; Wed, 19 May 2021 15:38:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRh9-0001Fx-3G for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21624) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRh7-0005R2-AW for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:26 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-192-wAs0aJ5CPt2zjjZ-F2drxg-1; Wed, 19 May 2021 15:17:22 -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 EFD1F801B21; Wed, 19 May 2021 19:17:21 +0000 (UTC) Received: from scv.redhat.com (ovpn-117-64.rdu2.redhat.com [10.10.117.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4114A5D9CC; Wed, 19 May 2021 19:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621451844; 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=uF/EpQitQKNkZn1ZK7H/xxOUXchsklFRlM+Lhot5zdA=; b=G0kWiJ8Iih/JEaztv0CFJQSgV5HBV1GwzZa2yp6uwFrISh9WIusZsvWTDVKENfz8+XfjIJ jiAq94LNlI8QB1nrfgAJ6lqho6KYa2ri/7LFInFhyA2hUa7dxUQ/SdaYStg8z0qq+jaesg b9l6sHyuIL1o2u2SkjdgF8ttDzKEmRg= X-MC-Unique: wAs0aJ5CPt2zjjZ-F2drxg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 2/6] qapi/parser: Allow empty QAPIDoc Sections Date: Wed, 19 May 2021 15:17:14 -0400 Message-Id: <20210519191718.3950330-3-jsnow@redhat.com> In-Reply-To: <20210519191718.3950330-1-jsnow@redhat.com> References: <20210519191718.3950330-1-jsnow@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=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It simplifies the typing to say that _section is always a QAPIDoc.Section(). To accommodate this change, we must allow for this object to evaluate to False for functions like _end_section which behave differently based on whether or not a Section has been started. Signed-off-by: John Snow --- Probably a better fix is to restructure the code to prevent _end_section() from being called twice in a row, but that seemed like more effort, but if you have suggestions for a tactical fix, I'm open to it. Signed-off-by: John Snow --- scripts/qapi/parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index b3a468504fc..71e982bff57 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -456,6 +456,9 @@ def __init__(self, parser, name=3DNone, indent=3D0): # the expected indent level of the text of this section self._indent =3D indent =20 + def __bool__(self) -> bool: + return bool(self.name or self.text) + def append(self, line): # Strip leading spaces corresponding to the expected indent le= vel # Blank lines are always OK. @@ -722,7 +725,7 @@ def _end_section(self): raise QAPIParseError( self._parser, "empty doc section '%s'" % self._section.name) - self._section =3D None + self._section =3D QAPIDoc.Section(self._parser) =20 def _append_freeform(self, line): match =3D re.match(r'(@\S+:)', line) --=20 2.30.2 From nobody Wed May 15 10:23:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453645; cv=none; d=zohomail.com; s=zohoarc; b=VxNPVCjtKOoACOb6FFcKx8Ac77oQveaKe/7AlOIKbbKFR+T2lYiqETbo85QA6adQpZ4G9VujRzBkS3Oa/oUA5pgK+plJcggDlxuHPd1VeiLZu8MQgmjU4OxpBSmfynvzkhg5MqA6GTA17MrFkGrexMKIJ/e+uqPN1Tpi8Gd+NSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453645; 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=eA2oJwLcqw+LfPt0ZOMu5jOASUlFlPcX/p6qyHEhwow=; b=NIZVwkDBP406lr3UtcWWKiqog7n9qnuASu/ss6qAwnSOZeDkXmLNyAc3lQYmGtF0rReNGoS4BtqfS8TqdJul18lGjG3kWX17luldwUIZyZ8ywL9hVecYH04vTTqRpB6EtfaAgwOlMBlqvZCDWHiGZPr8eiK11XY/D8774r1YQoY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621453645887558.2205013137527; Wed, 19 May 2021 12:47:25 -0700 (PDT) Received: from localhost ([::1]:39474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljSA8-00027S-QP for importer@patchew.org; Wed, 19 May 2021 15:47:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRha-0002OT-E4 for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRhR-0005eB-T6 for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:54 -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-274-fcnBrH4KMZO7GanwnChmag-1; Wed, 19 May 2021 15:17:23 -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 CF68F106BB29; Wed, 19 May 2021 19:17:22 +0000 (UTC) Received: from scv.redhat.com (ovpn-117-64.rdu2.redhat.com [10.10.117.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22C545D9CC; Wed, 19 May 2021 19:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621451865; 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=eA2oJwLcqw+LfPt0ZOMu5jOASUlFlPcX/p6qyHEhwow=; b=T8xpw+DkAvrzwjD9RB+CcY1IPTwZZXORvGyXqfnflO5KGiQKzQHgziN/i+pOo2oGvtotPN huHYnLdzPuXKj2cWFnDYX7WO4y4g7Q93VbNI5+Znj33Fy6m4m665mNw2knzl8B8Bq+dOcO uPvzVG5+e6oZWI96pmiOpoqX91LDGYc= X-MC-Unique: fcnBrH4KMZO7GanwnChmag-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 3/6] qapi/parser.py: add type hint annotations (QAPIDoc) Date: Wed, 19 May 2021 15:17:15 -0400 Message-Id: <20210519191718.3950330-4-jsnow@redhat.com> In-Reply-To: <20210519191718.3950330-1-jsnow@redhat.com> References: <20210519191718.3950330-1-jsnow@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=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Annotations do not change runtime behavior. This commit adds mostly annotations, but uses a TYPE_CHECKING runtime check to conditionally import dependencies, which only triggers during runs of mypy. Signed-off-by: John Snow --- TopLevelExpr, an idea from previous drafts, makes a return here in order to give a semantic meaning to check_expr(). The type is intended to be used more in forthcoming commits (pt5c), but I opted to include it now instead of creating yet-another Dict[str, object] type hint that I would forget to change later. Signed-off-by: John Snow --- scripts/qapi/parser.py | 74 +++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 71e982bff57..fefe4c37f44 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,14 @@ from .source import QAPISourceInfo =20 =20 +if TYPE_CHECKING: + # pylint: disable=3Dcyclic-import + from .schema import QAPISchemaFeature, QAPISchemaMember + + +#: 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 @@ -447,7 +456,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) @@ -459,7 +469,7 @@ def __init__(self, parser, name=3DNone, indent=3D0): def __bool__(self) -> bool: return bool(self.name or self.text) =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: @@ -474,39 +484,40 @@ 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: Optional[str] =3D None, indent: int =3D 0): 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 - 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() + self.args: Dict[str, QAPIDoc.ArgSection] =3D OrderedDict() + self.features: Dict[str, QAPIDoc.ArgSection] =3D OrderedDict() # a list of Section - self.sections =3D [] + 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 @@ -527,18 +538,18 @@ def append(self, line): line =3D line[1:] self._append_line(line) =20 - def end_comment(self): + def end_comment(self) -> None: self._end_section() =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 @@ -578,7 +589,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 @@ -624,7 +635,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(':'): @@ -656,7 +667,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 @@ -692,7 +703,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") @@ -704,13 +719,14 @@ def _start_symbol_section(self, symbols_dict, name, i= ndent): self._section =3D QAPIDoc.ArgSection(self._parser, name, indent) symbols_dict[name] =3D self._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) @@ -718,7 +734,7 @@ def _start_section(self, name=3DNone, indent=3D0): self._section =3D QAPIDoc.Section(self._parser, name, indent) self.sections.append(self._section) =20 - def _end_section(self): + def _end_section(self) -> None: if self._section: text =3D self._section.text =3D self._section.text.strip() if self._section.name and (not text or text.isspace()): @@ -727,7 +743,7 @@ def _end_section(self): "empty doc section '%s'" % self._section.name) self._section =3D QAPIDoc.Section(self._parser) =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, @@ -735,28 +751,28 @@ 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" % 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): + def check_args_section(args: Dict[str, QAPIDoc.ArgSection]) -> Non= e: bogus =3D [name for name, section in args.items() if not section.member] if bogus: --=20 2.30.2 From nobody Wed May 15 10:23:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453488; cv=none; d=zohomail.com; s=zohoarc; b=ZUgiqrKh280uF+cBcL+oVrPfqlKJtmKqp5cv7loCTdSlE5+7laAStIyZY3+CvFlRXioOC1+aAvK0KfHg/3s3W2yt+7by61vw41qj+k0mw2Rmo1f8AFwItHz6xCPvje8qdbkevqzcO+jnEFaKywxBUjLMbarlJjVyxZiBWLkWG7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453488; 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=zmDqW/TNOh7MpWKqmU3KIsSlhyQ0i9V7QbGLe/8xMv4=; b=Zuo9CQOVrL6mfbyuQwkTPIOmPgtgZ4qTQD2ieCDLw65oxEZRxpCktLcJhztkkeAuyjj9xSoUUcc9JK8Fi4fzjuNDZZfURXxEvVock5oeNr2yHcYO0z/8dnvacFtfojjz0kDBqicve+QgnAoe/cE3oiVxl5j+SBcQ+VKqOQrlnIA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162145348868345.746472260649625; Wed, 19 May 2021 12:44:48 -0700 (PDT) Received: from localhost ([::1]:59266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS7b-0004l5-Lx for importer@patchew.org; Wed, 19 May 2021 15:44:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRhA-0001N7-U1 for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRh9-0005SF-Bg for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-360-p51krl_XPZWTS9FgeObUIw-1; Wed, 19 May 2021 15:17:24 -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 ADC7F802575; Wed, 19 May 2021 19:17:23 +0000 (UTC) Received: from scv.redhat.com (ovpn-117-64.rdu2.redhat.com [10.10.117.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 013935D9CC; Wed, 19 May 2021 19:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621451846; 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=zmDqW/TNOh7MpWKqmU3KIsSlhyQ0i9V7QbGLe/8xMv4=; b=Zax2R2F+GUG1btyhlbX4GZzs19jDpvGwnN5C5nRQkM62QL6r5hArb+oZsZHiyrkZ4Y/8K3 Pq7SQzIYddH3+p1+IH6o2hz4DL/RFErUUcuRG4FRZz6bPQe6YU56NhoJ7q9ik7YsK/z5iL cZGGDFRLDy8z6fug+OUlwLRY271DTVQ= X-MC-Unique: p51krl_XPZWTS9FgeObUIw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 4/6] qapi/parser.py: enable mypy checks Date: Wed, 19 May 2021 15:17:16 -0400 Message-Id: <20210519191718.3950330-5-jsnow@redhat.com> In-Reply-To: <20210519191718.3950330-1-jsnow@redhat.com> References: <20210519191718.3950330-1-jsnow@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=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow --- scripts/qapi/mypy.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini index 54ca4483d6d..66253564297 100644 --- a/scripts/qapi/mypy.ini +++ b/scripts/qapi/mypy.ini @@ -3,11 +3,6 @@ strict =3D True disallow_untyped_calls =3D False python_version =3D 3.6 =20 -[mypy-qapi.parser] -disallow_untyped_defs =3D False -disallow_incomplete_defs =3D False -check_untyped_defs =3D False - [mypy-qapi.schema] disallow_untyped_defs =3D False disallow_incomplete_defs =3D False --=20 2.30.2 From nobody Wed May 15 10:23:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453265; cv=none; d=zohomail.com; s=zohoarc; b=fKODVcLK5tFTEZfj7e/utcHcj2QEhPAyQIMmj3jLlJT6woL8c8UsAkYLhe73pDi2Rx/GvtTKvxiYVvzxgxeK1G+awSuWV1toFFF2ADz2mRH1ylIRQqcm20EC0iDUi0OyuMyqDHbf4wg90hymfjRQCR8MCXLkByB4xqmvuDkPtuM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453265; 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=VsWEKjabr7sMpCHtFJFpR/YK9Ao1yGg7OZS5iTKDPGE=; b=lqASsTiEfRr+nGuxhTgwZQjlIxYpaJwdLIzrumcEojpt50NdRptOTttOs58x+MKq7ictXk/Zu0VEOlFLzyGX1+cC1UOj9UZ6BclofsbH/u7b8Obx2V9cn71CXdFzdTzFr7LFWgB37jTOaBN6iazjdpe262L+PlNnR7Na6ptFVdY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621453265473958.1674993479203; Wed, 19 May 2021 12:41:05 -0700 (PDT) Received: from localhost ([::1]:48724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS40-00063L-By for importer@patchew.org; Wed, 19 May 2021 15:41:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRhB-0001PW-Jq for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRh9-0005Si-O0 for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:29 -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-460-_LrNfDpoOCurVArUnjDQVg-1; Wed, 19 May 2021 15:17:25 -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 903B38015F8; Wed, 19 May 2021 19:17:24 +0000 (UTC) Received: from scv.redhat.com (ovpn-117-64.rdu2.redhat.com [10.10.117.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id D402D5D9CC; Wed, 19 May 2021 19:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621451847; 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=VsWEKjabr7sMpCHtFJFpR/YK9Ao1yGg7OZS5iTKDPGE=; b=do/nS8+IgtAnbi7WnhURujg57nblDzSHJZMnvGsc5ZECIoQAbgrEOJ6fUAORhyXPXqM+hr vLpK09qUNE225X8qdA0nJIag8+cd4WLhytsv+Q2ARnIgP5Wu+mFgIvMI/izR4WZxQyJ8YZ rQ2/Aqqq4H2kAWbCzBzrG8Yv1tqvxeI= X-MC-Unique: _LrNfDpoOCurVArUnjDQVg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 5/6] qapi/parser.py: Silence too-few-public-methods warning Date: Wed, 19 May 2021 15:17:17 -0400 Message-Id: <20210519191718.3950330-6-jsnow@redhat.com> In-Reply-To: <20210519191718.3950330-1-jsnow@redhat.com> References: <20210519191718.3950330-1-jsnow@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=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Eh. Two properties, a bool method and a public method are non-trivial enough for me. (Especially in typed python!) Signed-off-by: John Snow --- scripts/qapi/parser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index fefe4c37f44..36d4bd175a0 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -458,6 +458,8 @@ class QAPIDoc: class Section: def __init__(self, parser: QAPISchemaParser, name: Optional[str] =3D None, indent: int =3D 0): + # pylint: disable=3Dtoo-few-public-methods + # parser, for error messages about indentation self._parser =3D parser # optional section name (argument/member or section name) --=20 2.30.2 From nobody Wed May 15 10:23:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453532; cv=none; d=zohomail.com; s=zohoarc; b=Pi8Uy3PCd/d8DELjf45VHWG+NW6KSo1xfXa7/o9HoAdD1AM3GvyCDi3x7P/xNOnR9J4vplYAhCvcRnp3UcEPgLMRiRCSyJbOgkVulYFXOoGBx1VJEimOryziQk525Nn+hDpC701rRVImX9SfxWFu0xhflQx4YJQRgcOHF6IV65M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453532; 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=Bb7HOwstpcV+VJjAKv1JqV4YALy7uIFV9AvAvZXxkwE=; b=ahRolYgB7hJY3S3aZu6Qc6lx4qdifuY+IHelD85p78Itlhj2WzQ0hU1J5lz3y/hzETiEbEA+QyKZ7eAah1tyYYv9G3L1IGbgUHRCcBgw2fZFMG3l6AYid654otGRuSGXoh86zl6x2cO3BkAjfsdszdfqlncrdBR/Nv5lbwQG6tU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621453532311718.4957910142247; Wed, 19 May 2021 12:45:32 -0700 (PDT) Received: from localhost ([::1]:33048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS8J-00067b-93 for importer@patchew.org; Wed, 19 May 2021 15:45:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRhD-0001X5-Gc for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljRhB-0005Ub-Tw for qemu-devel@nongnu.org; Wed, 19 May 2021 15:17:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-56-5LdZfULRO6exT0kwlBfR4g-1; Wed, 19 May 2021 15:17:26 -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 82A11106BB2B; Wed, 19 May 2021 19:17:25 +0000 (UTC) Received: from scv.redhat.com (ovpn-117-64.rdu2.redhat.com [10.10.117.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6A235D9DC; Wed, 19 May 2021 19:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621451849; 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=Bb7HOwstpcV+VJjAKv1JqV4YALy7uIFV9AvAvZXxkwE=; b=ZOkBLi0CMM17MTkoKGCUvnhCmwtumFOIBtuJO20hfQw6zFphR2YxYucWfCubsYY3ZgGkvW gVtKBPY/ZG8rIi5VsAu0ghRdXzfEwYDi/MGe9NXPLFWJWYY5aCNkWwxFdvzIa7cucbH8V7 ceAb22f6CUF6h6s/D4QxijAepJDgH8w= X-MC-Unique: 5LdZfULRO6exT0kwlBfR4g-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 6/6] qapi/parser.py: enable pylint checks Date: Wed, 19 May 2021 15:17:18 -0400 Message-Id: <20210519191718.3950330-7-jsnow@redhat.com> In-Reply-To: <20210519191718.3950330-1-jsnow@redhat.com> References: <20210519191718.3950330-1-jsnow@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=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow --- scripts/qapi/pylintrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index c5275d5f59b..1a633b2b88e 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.30.2