Commit 02e30ca6 authored by Aarni Koskela's avatar Aarni Koskela
Browse files

Upgrade Ruff + configure formatting

parent fd723b78
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:
......
......@@ -8,6 +8,10 @@ src = [
"tests",
"benchmarking"
]
target-version = "py38"
line-length = 119
[tool.ruff.lint]
select = [
"B", # bugbear: security warnings
"E", # pycodestyle
......@@ -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)
......@@ -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",
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment