diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7afe60c20be..8721dac678b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,4 +5,20 @@ repos: rev: 24.3.0 hooks: - id: black - files: 'gdb/.*' + types_or: [file] + files: 'gdb/.*\.py(\.in)?$' + - repo: https://github.com/pycqa/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + types_or: [file] + # Note this one is only run on gdb/python, not (for now) the + # test suite. + files: 'gdb/python/.*\.py(\.in)?$' + args: [--config, gdb/setup.cfg] + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + types_or: [file] + files: 'gdb/.*\.py(\.in)?$' diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py.in index 54db9b00cf3..b5a7fa4f390 100644 --- a/gdb/gdb-gdb.py.in +++ b/gdb/gdb-gdb.py.in @@ -15,9 +15,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import gdb import os.path +import gdb + class TypeFlag: """A class that allows us to store a flag name, its short name,