public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: libstdc++@gcc.gnu.org, Tom Tromey <tromey@adacore.com>
Subject: [RFC 2/2] libstdc++: Add flake8 configuration
Date: Wed,  4 Oct 2023 10:58:32 -0600	[thread overview]
Message-ID: <20231004165832.1750191-3-tromey@adacore.com> (raw)
In-Reply-To: <20231004165832.1750191-1-tromey@adacore.com>

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<C, T> 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


  parent reply	other threads:[~2023-10-04 16:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 16:58 [RFC 0/2] black, isort, and " Tom Tromey
2023-10-04 16:58 ` [RFC 1/2] libstdc++: Use 'black' and 'isort' in pretty printers Tom Tromey
2023-10-04 16:58 ` Tom Tromey [this message]
2024-04-04 13:32 ` [RFC 0/2] black, isort, and flake8 configuration Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231004165832.1750191-3-tromey@adacore.com \
    --to=tromey@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).