Skip to content

Commit

Permalink
Migrate to ruff for formatting and import sorting (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
daneah authored Oct 11, 2024
1 parent 757c9b1 commit 0696611
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Changed

- Move from `setup.cfg` to `pyproject.toml` for package configuration
- Move from `black` to `ruff` for formatting
- Move from `isort` to `ruff` for import sorting

## [0.0.11] - 2024-10-09

### Added
Expand Down
26 changes: 18 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,24 @@ docs = [
# Tool configuration #
######################

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

[tool.isort]
profile = "black"
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
]

[tool.mypy]
strict = true
Expand Down Expand Up @@ -116,12 +128,10 @@ commands = [
[tool.tox.env.format]
skip_install = true
deps = [
"black",
"isort",
"ruff",
]
commands = [
["black", { replace = "posargs", default = ["--check", "--diff", "src", "test"], extend = true }],
["isort", { replace = "posargs", default = ["--check", "--diff", "src", "test"], extend = true }],
["ruff", "format", { replace = "posargs", default = ["--check", "--diff", "src", "test"], extend = true }],
]

[tool.tox.env.lint]
Expand Down

0 comments on commit 0696611

Please sign in to comment.