* [pushed] [pre-commit] Set stages for isort
@ 2026-07-18 8:18 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2026-07-18 8:18 UTC (permalink / raw)
To: gdb-patches
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.
---
.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
base-commit: 705b16039e6f1e499b96d8ecd08d5154f62d7d38
--
2.51.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-18 8:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-18 8:18 [pushed] [pre-commit] Set stages for isort Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox