Skip to content

Commit 02e30ca

Browse files
committed
Upgrade Ruff + configure formatting
1 parent fd723b7 commit 02e30ca

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.2.0
3+
rev: v0.3.2
44
hooks:
55
- id: ruff
66
args:
77
- --fix
8-
# - id: ruff-format # TODO: enable when the time is right
8+
- id: ruff-format
99
- repo: https://github.com/pre-commit/pre-commit-hooks
1010
rev: v4.5.0
1111
hooks:

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ src = [
88
"tests",
99
"benchmarking"
1010
]
11+
target-version = "py38"
12+
line-length = 119
13+
14+
[tool.ruff.lint]
1115
select = [
1216
"B", # bugbear: security warnings
1317
"E", # pycodestyle
@@ -17,7 +21,6 @@ select = [
1721
"UP", # alert you when better syntax is available in your python version
1822
"RUF", # the ruff developer's own rules
1923
]
20-
target-version = "py38"
2124
ignore = [
2225
"B007", # Loop control variable not used within the loop body (TODO: enable)
2326
"B028", # Warning without stacklevel (TODO: enable)
@@ -30,7 +33,7 @@ ignore = [
3033
]
3134
ignore-init-module-imports = true # allow to expose in __init__.py via imports
3235

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

45-
[tool.ruff.isort]
48+
[tool.ruff.lint.isort]
4649
combine-as-imports = true
4750
detect-same-package = true
4851
force-sort-within-sections = true

0 commit comments

Comments
 (0)