[1/2] Prepare gdb for isort

Message ID 20240320163957.3349962-2-tromey@adacore.com
State New
Headers
Series Use isort in gdb |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Tom Tromey March 20, 2024, 4:38 p.m. UTC
  This patch prepares gdb for isort: it adds a couple of isort marker
comments where needed, and it adds an isort clause to setup.cfg.
---
 gdb/python/lib/gdb/__init__.py     | 1 +
 gdb/python/lib/gdb/dap/__init__.py | 2 ++
 gdb/setup.cfg                      | 3 +++
 3 files changed, 6 insertions(+)
  

Patch

diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py
index e7d21fe8d27..5b96605240e 100644
--- a/gdb/python/lib/gdb/__init__.py
+++ b/gdb/python/lib/gdb/__init__.py
@@ -27,6 +27,7 @@  else:
     from imp import reload
 
 # Note that two indicators are needed here to silence flake8.
+# isort: split
 from _gdb import *  # noqa: F401,F403
 
 # Historically, gdb.events was always available, so ensure it's
diff --git a/gdb/python/lib/gdb/dap/__init__.py b/gdb/python/lib/gdb/dap/__init__.py
index f947314880c..81d435e742f 100644
--- a/gdb/python/lib/gdb/dap/__init__.py
+++ b/gdb/python/lib/gdb/dap/__init__.py
@@ -16,6 +16,7 @@ 
 import os
 
 # This must come before other DAP imports.
+# isort: split
 from . import startup
 
 # Load modules that define commands.  These imports intentionally
@@ -36,6 +37,7 @@  from . import scopes            # noqa: F401
 from . import sources           # noqa: F401
 from . import threads           # noqa: F401
 
+# isort: split
 from .server import Server
 
 
diff --git a/gdb/setup.cfg b/gdb/setup.cfg
index 2e83eb5cf56..d33058ea7f0 100644
--- a/gdb/setup.cfg
+++ b/gdb/setup.cfg
@@ -7,3 +7,6 @@ 
 # E701: Multiple statements on one line (colon)
 # W503: line break before binary operator
 ignore = E203,E501,E701,W503
+
+[isort]
+profile = black