Skip to content

Commit 5f635cf

Browse files
build(pyproject): migrate black and isort to ruff
1 parent 260b529 commit 5f635cf

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

.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
3024
run: uv run pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ repos:
1515
- id: requirements-txt-fixer
1616
- id: trailing-whitespace
1717

18-
- repo: https://github.com/psf/black
19-
rev: 26.1.0
20-
hooks:
21-
- id: black
22-
23-
- repo: https://github.com/PyCQA/isort
24-
rev: 8.0.0
25-
hooks:
26-
- id: isort
27-
2818
- repo: https://github.com/astral-sh/ruff-pre-commit
2919
rev: v0.15.2
3020
hooks:

pyproject.toml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ docs = [
3434
"pdoc==16.0.0",
3535
]
3636
lint = [
37-
"black==26.1.0",
38-
"isort==8.0.0",
3937
"mypy==1.19.1",
4038
"pre-commit==4.5.1",
4139
"ruff==0.15.2",
@@ -53,8 +51,21 @@ Issues = "https://github.com/remarkablemark/python-cli-template/issues"
5351
requires = ["hatchling"]
5452
build-backend = "hatchling.build"
5553

56-
[tool.black]
57-
fast = true
54+
[tool.ruff.lint]
55+
select = [
56+
"E", # pycodestyle errors
57+
"W", # pycodestyle warnings
58+
"F", # pyflakes
59+
"I", # isort (import sorting)
60+
"B", # flake8-bugbear
61+
"C4", # flake8-comprehensions
62+
"UP", # pyupgrade
63+
"ARG001", # unused arguments in functions
64+
"T201", # no print statements
65+
]
66+
ignore = [
67+
"E501", # line too long (handled by ruff)
68+
]
5869

5970
[tool.mypy]
6071
strict = true

0 commit comments

Comments
 (0)