diff --git a/.flake8 b/.flake8 index a6f727b..13aefa0 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,8 @@ [flake8] -ignore = E501, W503 +# Disable some formatted-related warnings that conflict with black's way of +# formatting code. +# +# E203: Whitespace before ':' +# E501: line too long +# E701: Multiple statements on one line (colon) +ignore = E203,E501,E701 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..7afe60c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 24.3.0 + hooks: + - id: black + files: 'gdb/.*' diff --git a/gui/commands.py b/gui/commands.py index d600e97..6fd24db 100644 --- a/gui/commands.py +++ b/gui/commands.py @@ -228,7 +228,7 @@ class GuiDprintfCommand(GuiPrintBase): if not arg.startswith(","): raise gdb.GdbError("comma expected after linespec") arg = arg[1:] - spec = arg[0:-len(arg)] + spec = arg[0 : -len(arg)] gui.dprintf.DPrintfBreakpoint(spec, window, arg)