[binutils-gdb] [pre-commit] Set stages for isort

Tom de Vries via Gdb-cvs <[email protected]> Sat, 18 Jul 2026 08:17:01 +0000 (GMT)
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D06653836fdd3=
3ac59d42d7dd6ae27c5f3a71080f

commit 06653836fdd33ac59d42d7dd6ae27c5f3a71080f
Author: Tom de Vries <[email protected]>
Date:   Sat Jul 18 10:16:57 2026 +0200

    [pre-commit] Set stages for isort
   =20
    I noticed that isort runs for the manual stage:
    ...
    $ pre-commit run --hook-stage manual
    isort...............................................(no files to check)=
Skipped
    ...
   =20
    That happens because unlike any other repo we're currently using, isort=
's
    .pre-commit-hooks.yaml sets stages:
    ...
    stages: [pre-commit, pre-merge-commit, pre-push, manual]
    ...
    overriding the default setting in our .pre-commit-config.yaml:
    ...
    default_stages: [pre-commit]
    ...
   =20
    Fix this by adding a stages setting to the isort hook.

Diff:
---
 .pre-commit-config.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 141f14ba72c..60164e446fc 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -74,6 +74,9 @@ repos:
     - id: isort
       types_or: *gdb_python_types
       files: *gdb_python_files
+      # Isort's .pre-commit-hooks.yaml sets stages, overriding default_sta=
ges,
+      # so this hook needs an explicit setting.
+      stages: [pre-commit]
=20
   # Codespell hooks.
   - repo: https://github.com/codespell-project/codespell