From nobody Fri May 3 12:23:26 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453628; cv=none; d=zohomail.com; s=zohoarc; b=dXRrCfeV300Ci6aUKYq3OzajGUMsEDcvTlRxV8IBAvUnZmbvvjWJGXKRG4wypA6jFkR6mNphD/EKWCRyfHtIgXbquknpfplh6v0M0DEX9qmpXIPziHrrlCpOtW6QnUcvc8pIc/1UpC+O6tCM/Iu7+YHPwKHFiTdgksLi0ll1a+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453628; 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=mzHT2W3cIEzInO/qGNY2CMQ2Wg31WUEOpQ/ilDZdXVPScmTfDhrE8xaJw+RlKFcJhPd3Za4x3zoRySeOWwCIz/C3Pzltx8ODQedU0wNt7CBpgax1Tp1NRceqmO7DyR1go6RxOJcSuquiWHrZWv+YIaXXRPL6dRkEumLxgBt3Jis= 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+importer2=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 1621453628227605.96558969087; Wed, 19 May 2021 12:47:08 -0700 (PDT) Received: from localhost ([::1]:37378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS9r-0000gq-8A for importer2@patchew.org; Wed, 19 May 2021 15:47:07 -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+importer2=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+importer2=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 Fri May 3 12:23:26 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453140; cv=none; d=zohomail.com; s=zohoarc; b=fgXIZCK24pAXHfjKQeUvtQ9jyJppGENLJWeS+mfYMGw0VDM3PZ0A0HYM/5am+SpbifsN2qQ86gJAAFHwIjKISZk8RCgvgKh0HQz9OV3SjoU/Mg+WS4Jw/E6LC5w2ySSwef8zMCu7/27k0q0UX4mN4AH/kcvbd+brYOleolnASXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453140; 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=Hq6PaPNKpnIz2WBV6uX6jREelVRupno/vY1WX89qSvg1nWuFWQpz0n9l6Bzles9KxbWBOvFnH48AXYEGXKbvAI6prlXorOVb+wXuU0IYL2uB17H7zG4zYIPU8Jb8SGODrB0OnomUnn1/FjLImCNEfF6u5N/yLE5+YUZebtWunF4= 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+importer2=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 1621453140453464.55755664412015; Wed, 19 May 2021 12:39:00 -0700 (PDT) Received: from localhost ([::1]:41926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS1y-0001TM-Fj for importer2@patchew.org; Wed, 19 May 2021 15:38:58 -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+importer2=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+importer2=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 Fri May 3 12:23:26 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453672; cv=none; d=zohomail.com; s=zohoarc; b=blsk7sCkv1RXmglDEcwolkMPgqPWXvjy+/YozK7esgh7KaaUyuTi5JYcxATA3JHXMlOhg2v4Tnnnqzee/7RI+NM1Z4MbKJUTElHekQY/w3y9YQhNEZ2dYvdWjWnkLMmZpgU8E2KEFS3Knc+wCYxNuhFfKJflrJSh08xYgTrt4G4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453672; 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=U8ky8Cr9rW404xvL9afV1MieBMdMVtz8I7UdKt4CB2IZE4wZibzKa3oVPyw8Ls3ueedPkqZySlTQyYbssPZKXTYUxSnmuXBa5zOnWKRIDqi9Hti+trj4kfQ4SHkliVO94m26nmw0myXi5TwAf+46j/pkgL3aBHkUsoxxCIpfF88= 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+importer2=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 1621453672491737.3080810431527; Wed, 19 May 2021 12:47:52 -0700 (PDT) Received: from localhost ([::1]:39474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljSAZ-00027S-EY for importer2@patchew.org; Wed, 19 May 2021 15:47:51 -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+importer2=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+importer2=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 Fri May 3 12:23:26 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453507; cv=none; d=zohomail.com; s=zohoarc; b=f1A28WCBGYPEECpwtNExWqmbTMtRZ3AebSDJAJPOB3b/dsVr1DP3NSw9Eub76d8+9V4rwu3Jx0hM1gVZp8HXQr5S/q8d9AbXgKN3bh/NnX+ShEiB2MRo1LXxXbTs7qAFy3scZSARusTZu3qsLjr7epw4pY9wWNAdVVa6vjt2JRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453507; 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=dP6GOIIFC47gh/nKE8b4rbQPOkUJcRKW9j7pkY4qefZLZGZV+7kdTw16IHgub/FW0rESQjhg6IvU9JDs6pcQD7JqoZFV5mskNyqg1SnIJbyoGCYSwUDqY3A4hwav8SmV7F0zQyASZe+RJMvoT4WqMECxcE5SBSdXtekixhTw/LQ= 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+importer2=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 1621453507134793.0365958792405; Wed, 19 May 2021 12:45:07 -0700 (PDT) Received: from localhost ([::1]:59266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS7q-0004l5-IT for importer2@patchew.org; Wed, 19 May 2021 15:45:04 -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+importer2=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+importer2=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 Fri May 3 12:23:26 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453274; cv=none; d=zohomail.com; s=zohoarc; b=d52Ct6GK4zXEnGeuYm3dutX0SLJyKIYXY502KmUvI9/cvGamnXfZxhygPzd+aWDFd9FYKZhB9eJsyQK3rVzod+VVkVJui9flX+pKvwq986n7Q5THu6z9W/wJjSqsPHin73w0HY6v9a8T/sudRtK7wzaw4gN3MrHMT2YvjGp47LI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453274; 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=Zjr5HQHyK7DwWZcYi3cQg7hR9SXGzfZeJn7iI1465s09pIwT+sChh3QAe5F7fHivJX3MtPreJV8Jpvo7rxjnNNQLczm2RpAFq1W6gCFBxG8fwN7jM1rppvFQ6DR29at7iwUq2/DGuRwvIxnIDeCkbGkp7LBniskoW3XJCx9YrRI= 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+importer2=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 1621453274989783.0497327287618; Wed, 19 May 2021 12:41:14 -0700 (PDT) Received: from localhost ([::1]:48724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS49-00063L-U3 for importer2@patchew.org; Wed, 19 May 2021 15:41:13 -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+importer2=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+importer2=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 Fri May 3 12:23:26 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621453542; cv=none; d=zohomail.com; s=zohoarc; b=CfvZFJB0QuveSV5j7rdKxh+LSFtXP/7PVFoa+0P6EXwzC91YU+AwAuAAmQUE/fi64fmLib5ywfrq++UShtNr7Oo4elvDK/BUtcORUTy4Y+u4zdifCUnFPe3Cd0/Z9c9uA+X0z4sttZWNo+1VqKYEyFp9vW3aEa6WOv2q6PHd470= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621453542; 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=DSwYQaoxilWvfQP4ZseuWj/9VryByiaUeDhyBVIBy9J9eah1hr88+ZrXoLGqWOJJLGNwvH4uswRz96bbqiLiM3C198Nxn0SOotZJUa0Wdb2ku9k7qaE4mhQOHyGna6U3PAsnxk6+ganICZmC7RjgOoZOknVyHcrhbBxw4pF5OQc= 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+importer2=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 1621453542409589.010209219; Wed, 19 May 2021 12:45:42 -0700 (PDT) Received: from localhost ([::1]:33048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljS8T-00067b-94 for importer2@patchew.org; Wed, 19 May 2021 15:45:41 -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+importer2=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+importer2=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