From patchwork Wed Oct 4 16:58:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 148424 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp273713vqb; Wed, 4 Oct 2023 10:00:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtSva6yhp3nbPer91W36dp7bIJC5MjjaT8453dfHAZfHiNbB+EaPvfPfasSYh0vjl9yXnJ X-Received: by 2002:aa7:d293:0:b0:533:4fad:2e5f with SMTP id w19-20020aa7d293000000b005334fad2e5fmr2450321edq.12.1696438854008; Wed, 04 Oct 2023 10:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696438853; cv=none; d=google.com; s=arc-20160816; b=BlRRLFRyqnPdGURwf7lErCvf50mqtUgtT1+HQ5rueXM3MzOr7Ue3hDmEDNomr3Gquj ZQ6G1vGsfjR/sIHvY5pgP8c66MQj58FiHC2CZUEn/DtQHGNZv22hG/imqsW2i/hLFYwb DMqOGnY0aIldAv9WC0Fu6+V+qzBxmiuksTsdVHZEmTQST89/o1b8gd3Hq/SxTbYb9U2x 7wGhRnPrrE+aNGQvoKSpZZ6iVPShtRIxda3sSd0tvI/Hpxrk5vejIYO3QWH9pvxHr/c+ oyOfWvdY4mA3soD00Z0hOKT/TFsLG5qRy5BZejyXsvV8dzKIh7FBlREtQmA6KCL86Ll5 fNRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=cGyhYGHVYPDfWSJ2tlWrK8TtCSc7F7YL4VP4B8SMm1k=; fh=Ogh3zaPUNpdNYHofIVNHsbX+D3lwaT1T8Jhe/MolwAA=; b=i1kYbnUCzZpUBzsmL6BKC2wFtlF4kE87GbllHqPnWW4RzLxDAH0oZVlG8ljCxzSG1I j3WYA51APCEJNKXpHNGP/p7awKGdokCJqubkFMoAjeY70DMuAmcGWtYsvw/rTE8E8L7H P/0LW/R/w3UFQFUAUzihjO2v8leuxJDXPMeTW9DA7rt1FW6/htbm5b6FhqQW7GPV9ggL hQFnwxQoK734rEdmC+Bu7YMuD8rPx1E/kVqZ0xAzwDzgq7h+UlCFB5Dk0Uk5v15L6tTp eGJXp+xeDjS7Ybb7EbnEhK6SC1nrQ2s6vZcwDIHiX4vLunKKGQEBrpD6uNoaQfQjTV4R MxAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=DEZBScah; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w11-20020aa7da4b000000b0053782c81517si83990eds.416.2023.10.04.10.00.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:00:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=DEZBScah; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 466263885505 for ; Wed, 4 Oct 2023 16:59:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by sourceware.org (Postfix) with ESMTPS id 841B2385CC88 for ; Wed, 4 Oct 2023 16:58:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 841B2385CC88 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-79f8e4108c3so2815039f.3 for ; Wed, 04 Oct 2023 09:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1696438726; x=1697043526; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cGyhYGHVYPDfWSJ2tlWrK8TtCSc7F7YL4VP4B8SMm1k=; b=DEZBScahuC5LcXEgRqQG5IlQdBLZmoJzvr6iL0jHlUdHqOf35oPfzzKGYsuXFsjHXQ ztNVDkx66Bv99UiKuEcPXGcKIsnifMYMcDXBJvws9eK1WvPT9lcjYMcbunlx1eXE/RRd 0f2KZfJCCCyGN8BbSj3clyxMWuQA9xZcLs8IYCnoVOPbcsdPmuK0WQ5SuspkiAmZ1Nlt YRUm9m8Ohiv3q33EGM8WxHizwvyyFhSscq7N5vInmmyYbH6qyXwdaCca2DUEKJvS343v m/FhtwZ7rKtIX3R3Z5d2hA4a9kMSp79HYpp9ABloUIRKgvhZ5k0JKMBlp4xl6skDgLHa cFnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696438726; x=1697043526; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cGyhYGHVYPDfWSJ2tlWrK8TtCSc7F7YL4VP4B8SMm1k=; b=Oa012bOvUlhQgys6n7Ux4pKOTPSccg1JXcRRiqU6335IVEZFRimykfYo5eKx/6ZhId k6NV59yublSlac+YRgTeqoS/UZle7W5hJF7VW/EOuS2O3vVXMJ3L6BOSe7yPkg8nrTyf 1/+OSZVDQJ+fBWqEwvTk0qL639VhzITeNl8FNzcVCN3HSLxc/xVD/NdufKz43kHVQzzu tReuPpmEPPBlUCMEKNlBKyXOqKKATmwuZFTlwQgO0Mgzpt4oXAFcoax25X2KAgFQwYDY g02U82KJDGTqDV+j9dntKnepOjzcIQVuLFrjZksk28J+xQIpnxWB5HMZzfqsx+7bGhlz v6Fg== X-Gm-Message-State: AOJu0YwrRrQ0DnbTv0Bf94mOIW+EIPAl9UA2i3OQiEvryXlEYBG4ZNjr SKHvF8Q8jioilQAhh8Lj/tr0qg39Oo36+5xTihkZCg== X-Received: by 2002:a5e:a801:0:b0:787:1697:1b3b with SMTP id c1-20020a5ea801000000b0078716971b3bmr3069479ioa.8.1696438725776; Wed, 04 Oct 2023 09:58:45 -0700 (PDT) Received: from localhost.localdomain (71-211-130-31.hlrn.qwest.net. [71.211.130.31]) by smtp.gmail.com with ESMTPSA id e4-20020a02a784000000b0043cec02791bsm1066491jaj.96.2023.10.04.09.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 09:58:45 -0700 (PDT) From: Tom Tromey To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Tom Tromey Subject: [RFC 2/2] libstdc++: Add flake8 configuration Date: Wed, 4 Oct 2023 10:58:32 -0600 Message-Id: <20231004165832.1750191-3-tromey@adacore.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004165832.1750191-1-tromey@adacore.com> References: <20231004165832.1750191-1-tromey@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778845067448158338 X-GMAIL-MSGID: 1778845067448158338 flake8 is a Python linter. This patch adds a .flake8 configuration file (flake8 does not use pyproject.toml for some reason) and fixes a few trivial flake8 warnings. After this patch, the only remaining flake8 warnings are about unused imports (there are two - but they are not completely trivial to remove) and the use of bare "except:". It is possible to change the flake8 configuration to suppress these warnings, but I haven't done so here. libstdc++-v3/ChangeLog: * python/.flake8: New file. * python/libstdcxx/v6/__init__.py: Remove blank line. * python/libstdcxx/v6/printers.py: Reformat two comments. --- libstdc++-v3/python/.flake8 | 3 +++ libstdc++-v3/python/libstdcxx/__init__.py | 1 - libstdc++-v3/python/libstdcxx/v6/printers.py | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 libstdc++-v3/python/.flake8 diff --git a/libstdc++-v3/python/.flake8 b/libstdc++-v3/python/.flake8 new file mode 100644 index 00000000000..7ffe4d6e0f7 --- /dev/null +++ b/libstdc++-v3/python/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 79 +extend-ignore = E203 diff --git a/libstdc++-v3/python/libstdcxx/__init__.py b/libstdc++-v3/python/libstdcxx/__init__.py index 8b137891791..e69de29bb2d 100644 --- a/libstdc++-v3/python/libstdcxx/__init__.py +++ b/libstdc++-v3/python/libstdcxx/__init__.py @@ -1 +0,0 @@ - diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index e26b8b36013..202fa450a91 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -2672,8 +2672,8 @@ class FilteringTypePrinter(object): name (str): The typedef-name that will be used instead. targ1 (str, optional): The first template argument. Defaults to None. - Checks if a specialization of the class template 'template' is the same type - as the typedef 'name', and prints it as 'name' instead. + Checks if a specialization of the class template 'template' is the same + type as the typedef 'name', and prints it as 'name' instead. e.g. if an instantiation of std::basic_istream is the same type as std::istream then print it as std::istream. @@ -3167,8 +3167,8 @@ def build_libstdcxx_dictionary(): libstdcxx_printer.add_version( 'std::chrono::', 'tzdb', StdChronoTzdbPrinter ) - # libstdcxx_printer.add_version('std::chrono::(anonymous namespace)', 'Rule', - # StdChronoTimeZoneRulePrinter) + # libstdcxx_printer.add_version('std::chrono::(anonymous namespace)', + # 'Rule', StdChronoTimeZoneRulePrinter) # Extensions. libstdcxx_printer.add_version('__gnu_cxx::', 'slist', StdSlistPrinter)