public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix two minor flake8 issues
@ 2024-02-23 19:01 Tom Tromey
  2024-02-23 19:33 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2024-02-23 19:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

flake8 pointed out some extra whitespace around ':' in some Python
code.
---
 gdb/python/lib/gdb/command/frame_filters.py | 2 +-
 gdb/python/lib/gdb/prompt.py                | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/python/lib/gdb/command/frame_filters.py b/gdb/python/lib/gdb/command/frame_filters.py
index 47045518e64..41f61ff19bc 100644
--- a/gdb/python/lib/gdb/command/frame_filters.py
+++ b/gdb/python/lib/gdb/command/frame_filters.py
@@ -191,7 +191,7 @@ def _complete_frame_filter_list(text, word, all_flag):
 
     # If we only have one completion, complete it and return it.
     if len(flist) == 1:
-        flist[0] = flist[0][len(text) - len(word) :]
+        flist[0] = flist[0][len(text) - len(word):]
 
     # Otherwise, return an empty list, or a list of frame filter
     # dictionaries that the previous filter operation returned.
diff --git a/gdb/python/lib/gdb/prompt.py b/gdb/python/lib/gdb/prompt.py
index 02185b353df..e00e4b0a521 100644
--- a/gdb/python/lib/gdb/prompt.py
+++ b/gdb/python/lib/gdb/prompt.py
@@ -146,7 +146,7 @@ def substitute_prompt(prompt):
                     if j >= plen or prompt[j] != "}":
                         arg = None
                     else:
-                        arg = prompt[i + 2 : j]
+                        arg = prompt[i + 2:j]
                         i = j
                 else:
                     arg = None
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix two minor flake8 issues
  2024-02-23 19:01 [PATCH] Fix two minor flake8 issues Tom Tromey
@ 2024-02-23 19:33 ` Simon Marchi
  2024-02-23 19:39   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2024-02-23 19:33 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches



On 2024-02-23 14:01, Tom Tromey wrote:
> flake8 pointed out some extra whitespace around ':' in some Python
> code.

If we change these, black is going to immediately want to revert them.

We need to tell flake8 to ignore these formatting warnings, since the
formatting is all taken care of.  See:

https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8

I propose to just add this in gdb/.flake8 or gdb/setup.cfg, as the page
suggests:

[flake8]
max-line-length = 88
extend-ignore = E203,E701

Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix two minor flake8 issues
  2024-02-23 19:33 ` Simon Marchi
@ 2024-02-23 19:39   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2024-02-23 19:39 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, gdb-patches

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> If we change these, black is going to immediately want to revert them.

lol I forgot about this.

Simon> I propose to just add this in gdb/.flake8 or gdb/setup.cfg, as the page
Simon> suggests:

Simon> [flake8]
Simon> max-line-length = 88
Simon> extend-ignore = E203,E701

Please do.

Internally I see we use:

# See
# https://github.com/psf/black/blob/master/docs/compatible_configs.md#black-compatible-configurations
# to understand the max-line-length and extend-ignore settings.
max-line-length = 88
extend-ignore: E203, W503, B906, B907

I don't remember what these other ones are about.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-23 19:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-23 19:01 [PATCH] Fix two minor flake8 issues Tom Tromey
2024-02-23 19:33 ` Simon Marchi
2024-02-23 19:39   ` Tom Tromey

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).