Skip to content

Commit

Permalink
chore(isort): replace isort with ruff
Browse files Browse the repository at this point in the history
This commit replaces `isort` with `ruff`:
- `ruff` hook has been added to pre-commit
- `setup.cfg` configuration disappears in favor of `pyproject.toml`

Note that only `I` rule is selected, other linters (flake8, ...) can be migrated in follow-up steps.
  • Loading branch information
stegayet committed Jan 27, 2025
1 parent a0175b0 commit 06b6ab8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ repos:
- id: check-yaml
- id: mixed-line-ending

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
pass_filenames: false

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.3
hooks:
- id: ruff
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ omit = [
"*/pypy/*",
"*kombu/utils/debug.py",
]

[tool.ruff.lint]
select = ["I"]

[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
4 changes: 0 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ per-file-ignores =
# docstrings
D,

[isort]
add_imports =
from __future__ import annotations

[mypy]
warn_unused_configs = True
strict = False
Expand Down

0 comments on commit 06b6ab8

Please sign in to comment.