Skip to content

Commit 24ec957

Browse files
committed
[chore] pre-commit autoupdate
And fix warnings: ``` warning: The `--show-source` argument is deprecated. Use `--output-format=full` instead. warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`: - 'ignore' -> 'lint.ignore' - 'select' -> 'lint.select' - 'flake8-builtins' -> 'lint.flake8-builtins' - 'isort' -> 'lint.isort' - 'per-file-ignores' -> 'lint.per-file-ignores' warning: `TRY200` has been remapped to `B904`. warning: Selection `FURB` has no effect because preview is not enabled. ``` Part-of: #45
1 parent c9b1fca commit 24ec957

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ repos:
1212
files: '^src/\w+/(tests|0\.0\.0)/.*\.py$'
1313

1414
- repo: https://github.com/astral-sh/ruff-pre-commit
15-
rev: v0.1.9
15+
rev: v0.3.0
1616
hooks:
1717
- id: ruff
1818
name: Check code with Ruff, apply automatic fixes
19-
args: [ --fix, --show-fixes, --show-source, --exit-non-zero-on-fix ]
19+
args: [ --exit-non-zero-on-fix ]
2020
- id: ruff-format
2121
name: Format code with Ruff
2222
- repo: https://github.com/pre-commit/pre-commit-hooks

pyproject.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ version-file = "src/_version.py"
2626
[tool.ruff]
2727
fix = true
2828
show-fixes = true
29+
output-format = "full"
30+
line-length = 120
31+
32+
[tool.ruff.lint]
2933
ignore = [
3034
"B904", # raise-without-from-inside-except; not python2 compatible
3135
"B905", # zip-without-explicit-strict; not python2 compatible
@@ -37,7 +41,6 @@ ignore = [
3741

3842
"PLR2004", # magic-value-comparison; not all comparisons to int or str are magic
3943
"TRY003", # raise-vanilla-args; we can live without it
40-
"TRY200", # reraise-no-cause; not python2 compatible
4144
"RET505", # only true for simple if/elif branches (like in the ruff doc example). if/elif blocks are easier to read in most cases
4245

4346
"ISC001", # avoid incompatibility with the ruff formatter
@@ -50,7 +53,6 @@ ignore = [
5053
# "E203",
5154
# "B907",
5255
]
53-
line-length = 120
5456
select = [
5557
# full rule-sets
5658
"A", # flake8-builtins
@@ -59,7 +61,6 @@ select = [
5961
"E", # pycodestyle
6062
"ERA", # eradicate
6163
"F", # Pyflakes
62-
"FURB", # refurb
6364
"G", # flake8-logging-format
6465
"I", # isort
6566
"ISC", # flake8-implicit-str-concat
@@ -80,19 +81,19 @@ select = [
8081

8182
]
8283

83-
[tool.ruff.flake8-builtins]
84+
[tool.ruff.lint.flake8-builtins]
8485
builtins-ignorelist = ["format", "id", "type"]
8586

86-
[tool.ruff.isort]
87+
[tool.ruff.lint.isort]
8788
section-order = ["future", "standard-library", "third-party", "first-party", "odoo-addons", "local-folder"]
8889
known-first-party = ["odoo", "openerp"]
8990
known-local-folder = ["odoo.upgrade", "odoo.addons.base.maintenance.migrations", "openerp.addons.base.maintenance.migrations"]
9091

91-
[tool.ruff.isort.sections]
92+
[tool.ruff.lint.isort.sections]
9293
odoo-addons = ["odoo.addons", "openerp.addons"]
9394

9495

95-
[tool.ruff.per-file-ignores]
96+
[tool.ruff.lint.per-file-ignores]
9697
"*/__init__.py" = [
9798
"F401",
9899
"F403",

0 commit comments

Comments
 (0)