Skip to content

Commit

Permalink
Upgrade Ruff + configure formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Mar 13, 2024
1 parent fd723b7 commit 02e30ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.3.2
hooks:
- id: ruff
args:
- --fix
# - id: ruff-format # TODO: enable when the time is right
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ src = [
"tests",
"benchmarking"
]
target-version = "py38"
line-length = 119

[tool.ruff.lint]
select = [
"B", # bugbear: security warnings
"E", # pycodestyle
Expand All @@ -17,7 +21,6 @@ select = [
"UP", # alert you when better syntax is available in your python version
"RUF", # the ruff developer's own rules
]
target-version = "py38"
ignore = [
"B007", # Loop control variable not used within the loop body (TODO: enable)
"B028", # Warning without stacklevel (TODO: enable)
Expand All @@ -30,7 +33,7 @@ ignore = [
]
ignore-init-module-imports = true # allow to expose in __init__.py via imports

[tool.ruff.extend-per-file-ignores]
[tool.ruff.lint.extend-per-file-ignores]
"**/__init__.py" = ["F401"] # allow unused imports in __init__.py
"{benchmarking,tests}/**/*.py" = [
"B007",
Expand All @@ -42,7 +45,7 @@ ignore-init-module-imports = true # allow to expose in __init__.py via imports
"UP030",
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true
detect-same-package = true
force-sort-within-sections = true
Expand Down

0 comments on commit 02e30ca

Please sign in to comment.