Fix two minor flake8 issues
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
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(-)
Comments
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
>>>>> "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
@@ -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.
@@ -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