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

Tom de Vries vries@sourceware.org
Sat Jul 18 08:17:01 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=06653836fdd33ac59d42d7dd6ae27c5f3a71080f

commit 06653836fdd33ac59d42d7dd6ae27c5f3a71080f
Author: Tom de Vries <tdevries@suse.de>
Date:   Sat Jul 18 10:16:57 2026 +0200

    [pre-commit] Set stages for isort
    
    I noticed that isort runs for the manual stage:
    ...
    $ pre-commit run --hook-stage manual
    isort...............................................(no files to check)Skipped
    ...
    
    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]
    ...
    
    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_stages,
+      # so this hook needs an explicit setting.
+      stages: [pre-commit]
 
   # Codespell hooks.
   - repo: https://github.com/codespell-project/codespell


More information about the Binutils-cvs mailing list