Skip to content

Commit 0439334

Browse files
committed
Fix isort deprecation warning by explicitly setting stages
- Add stages: [pre-commit] to isort hook configuration - This overrides deprecated stage names from the repository - Update documentation to explain the fix
1 parent 3d22c46 commit 0439334

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ repos:
3333
- id: isort
3434
args: [--profile=black]
3535
files: ^\.github/scripts/.*\.py$
36+
stages: [pre-commit] # Override deprecated stage names from repository
3637

3738
- repo: https://github.com/astral-sh/ruff-pre-commit
3839
rev: v0.1.9

docs/development/PRE_COMMIT.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ git commit --no-verify -m "message"
107107

108108
## Troubleshooting
109109

110+
### Deprecation Warnings
111+
112+
If you see warnings about deprecated stage names, they have been addressed in our configuration by explicitly setting `stages: [pre-commit]` for hooks that have this issue. This overrides the deprecated stage names defined in the hook repositories themselves.
113+
114+
If you still see warnings after updating hooks, run:
115+
116+
```bash
117+
pre-commit autoupdate --repo https://github.com/pycqa/isort
118+
```
119+
120+
This will update to the latest version that may have fixed the issue.
121+
110122
### Hooks are slow
111123

112124
- First run downloads tools (one-time)

0 commit comments

Comments
 (0)