Skip to content

Commit 0696611

Browse files
authored
Migrate to ruff for formatting and import sorting (#34)
1 parent 757c9b1 commit 0696611

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
### Changed
11+
12+
- Move from `setup.cfg` to `pyproject.toml` for package configuration
13+
- Move from `black` to `ruff` for formatting
14+
- Move from `isort` to `ruff` for import sorting
15+
1016
## [0.0.11] - 2024-10-09
1117

1218
### Added

pyproject.toml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,24 @@ docs = [
5151
# Tool configuration #
5252
######################
5353

54-
[tool.black]
54+
[tool.ruff]
5555
line-length = 120
56-
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
5756

58-
[tool.isort]
59-
profile = "black"
57+
[tool.ruff.lint]
58+
select = [
59+
# pycodestyle
60+
"E",
61+
# Pyflakes
62+
"F",
63+
# pyupgrade
64+
"UP",
65+
# flake8-bugbear
66+
"B",
67+
# flake8-simplify
68+
"SIM",
69+
# isort
70+
"I",
71+
]
6072

6173
[tool.mypy]
6274
strict = true
@@ -116,12 +128,10 @@ commands = [
116128
[tool.tox.env.format]
117129
skip_install = true
118130
deps = [
119-
"black",
120-
"isort",
131+
"ruff",
121132
]
122133
commands = [
123-
["black", { replace = "posargs", default = ["--check", "--diff", "src", "test"], extend = true }],
124-
["isort", { replace = "posargs", default = ["--check", "--diff", "src", "test"], extend = true }],
134+
["ruff", "format", { replace = "posargs", default = ["--check", "--diff", "src", "test"], extend = true }],
125135
]
126136

127137
[tool.tox.env.lint]

0 commit comments

Comments
 (0)