Skip to content

Commit b67481d

Browse files
build(pyproject): migrate black and isort to ruff
1 parent a9aaf8e commit b67481d

3 files changed

Lines changed: 17 additions & 22 deletions

File tree

.github/workflows/lint.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,5 @@ jobs:
2020
- name: Type check
2121
run: uv run mypy .
2222

23-
- name: Run Black
24-
run: uv run black --check .
25-
26-
- name: Run Ruff
27-
run: uv run ruff check
28-
2923
- name: Run pre-commit hooks
3024
run: uv run pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,9 @@ repos:
1515
- id: requirements-txt-fixer
1616
- id: trailing-whitespace
1717

18-
- repo: https://github.com/psf/black
19-
rev: 25.1.0
20-
hooks:
21-
- id: black
22-
23-
- repo: https://github.com/PyCQA/isort
24-
rev: 6.0.1
25-
hooks:
26-
- id: isort
27-
2818
- repo: https://github.com/astral-sh/ruff-pre-commit
29-
rev: v0.11.2
19+
rev: v0.15.2
3020
hooks:
3121
- id: ruff
32-
args: [ --fix ]
22+
args: [--fix]
3323
- id: ruff-format

pyproject.toml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ docs = [
2020
"pdoc==16.0.0",
2121
]
2222
lint = [
23-
"black==26.1.0",
24-
"isort==8.0.0",
2523
"mypy==1.19.1",
2624
"pre-commit==4.5.1",
2725
"ruff==0.15.2",
@@ -39,8 +37,21 @@ Issues = "https://github.com/remarkablemark/python-package-template/issues"
3937
requires = ["hatchling"]
4038
build-backend = "hatchling.build"
4139

42-
[tool.black]
43-
fast = true
40+
[tool.ruff.lint]
41+
select = [
42+
"E", # pycodestyle errors
43+
"W", # pycodestyle warnings
44+
"F", # pyflakes
45+
"I", # isort (import sorting)
46+
"B", # flake8-bugbear
47+
"C4", # flake8-comprehensions
48+
"UP", # pyupgrade
49+
"ARG001", # unused arguments in functions
50+
"T201", # no print statements
51+
]
52+
ignore = [
53+
"E501", # line too long (handled by ruff)
54+
]
4455

4556
[tool.mypy]
4657
strict = true

0 commit comments

Comments
 (0)