Skip to content

Commit

Permalink
Merge pull request #239 from jodal/ruff-format
Browse files Browse the repository at this point in the history
Replace Black with 'ruff format'
  • Loading branch information
jodal authored Nov 6, 2023
2 parents 6ff710a + 63c6114 commit 6a84204
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
12 changes: 6 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ def tests(session: nox.Session) -> None:


@nox.session(python=supported_pythons)
def black(session: nox.Session) -> None:
"""Check formatting using Black."""
def ruff_format(session: nox.Session) -> None:
"""Check formatting using Ruff."""
args = session.posargs or locations
session.run(
"poetry", "install", "--quiet", "--no-root", "--only=black", external=True
"poetry", "install", "--quiet", "--no-root", "--only=ruff", external=True
)
session.run("black", *args)
session.run("ruff", "format", "--check", *args)


@nox.session(python=supported_pythons)
def ruff(session: nox.Session) -> None:
"""Lint using ruff."""
def ruff_lint(session: nox.Session) -> None:
"""Lint using Ruff."""
args = session.posargs or locations
session.run(
"poetry", "install", "--quiet", "--no-root", "--only=ruff", external=True
Expand Down
9 changes: 2 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ py-moneyed = { version = ">=0.8", optional = true }
[tool.poetry.extras]
money = ["py-moneyed"]

[tool.poetry.group.black.dependencies]
black = "^23.9.1"

[tool.poetry.group.darglint.dependencies]
darglint = "^1.8.1"

Expand All @@ -47,17 +44,14 @@ mypy = "^1.5.1"
pyright = "^1.1.329"

[tool.poetry.group.ruff.dependencies]
ruff = "^0.0.292"
ruff = "^0.1.4"

[tool.poetry.group.tests.dependencies]
coverage = { extras = ["toml"], version = "^7.3.2" }
pytest = "^7.4.2"
pytest-cov = "^4.1.0"
xdoctest = "^1.1.1"

[tool.black]
target-version = ["py38", "py39", "py310", "py311", "py312"]

[tool.coverage.paths]
source = ["src"]

Expand Down Expand Up @@ -127,6 +121,7 @@ ignore = [
"A003", # builtin-attribute-shadowing
"ANN101", # missing-type-self
"ANN102", # missing-type-cls
"ISC001", # single-line-implicit-string-concatenation
"PLR2004", # magic-value-comparison
"RET504", # unnecessary-assign
"TRY003", # raise-vanilla-args
Expand Down

0 comments on commit 6a84204

Please sign in to comment.