From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by sourceware.org (Postfix) with ESMTPS id A1EFD3860753 for ; Wed, 4 Oct 2023 16:58:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A1EFD3860753 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-xd31.google.com with SMTP id ca18e2360f4ac-79fa2dbd793so2945939f.2 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=EyHgFOhIopjC+Jfd1DubTTe87bQIzXtIycFO1NXFKy6xi6NX1gD8ZWqKuIYA9t4dDo xdqhs3vmHGsGvwWSQTT/rTd/Zp5+8YCL7ShWJdStorI/ZlRgqmp5hb8lYYAxqkSm3Llr rCXF+Agw1KdLs7TFF7N5FS+eX+MNi9pDJ0iwDtETHJ6NblzR92LZmK15KczgmymC2Z2G Qs43NeMoX/mwrzvgI1nopYwvdnJrOVl7IRo7LHW6A73RdAQTd1XKcB/MGAHiNhKDQ8BI AlsL7NIOV7vP53v4HM5jeFvFzV4UttA4Rlv/CauPrRXRV04LKRUUt/CL9p4pgrFuI3KC AK4w== X-Gm-Message-State: AOJu0YxOi25OZj9c30ZSHngM6mX6FbH1Kx1MHbPHvd8JPA4TtVA9Xz0t cybrKKLr7bUDHetwcoT9LrGbHA== X-Google-Smtp-Source: AGHT+IGXUGCtfpMQKz7LEh1VzCoVnkN5sSotVHflOtn1I7awEjekNZCxoG1hs7FigyWpKKqaPUeelg== 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.2 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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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) -- 2.40.1