Skip to content

Commit

Permalink
Use 'ruff format', instead of 'black'
Browse files Browse the repository at this point in the history
Despite being the de facto standard in the community, let's switch from
the black formatter to the ruff formatter. The latter is mostly
compatible with the former but dozen times faster. So why use many tools
if you can use just one?

Since Holocron is a pet project and a great playground for me, let's how
far 'ruff format' can get.
  • Loading branch information
ikalnytskyi committed Nov 6, 2023
1 parent 157aba6 commit ab4e20c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ scripts.run = "python -m pytest {args:-vv}"

[tool.hatch.envs.lint]
detached = true
dependencies = ["black >= 23.10.1", "ruff >= 0.1.3"]
scripts.check = ["ruff {args:.}", "black --check --diff {args:.}"]
scripts.fmt = ["ruff --fix {args:.}", "black {args:.}"]
dependencies = ["ruff >= 0.1.4"]
scripts.check = ["ruff {args:.}", "ruff format --check --diff {args:.}"]
scripts.fmt = ["ruff --fix {args:.}", "ruff format {args:.}"]

[tool.ruff]
select = ["F", "E", "W", "I", "S", "FBT", "B", "C4", "DTZ", "T10", "ISC", "RET", "SLF", "RUF"]
ignore = ["S603", "S701", "B904"]
ignore = ["S603", "S701", "B904", "ISC001"]

[tool.ruff.isort]
known-first-party = ["holocron"]
Expand Down

0 comments on commit ab4e20c

Please sign in to comment.