Skip to content

Commit 3edf772

Browse files
committed
Upgrade pre-commit tools, fix ruff issues
1 parent b02aeec commit 3edf772

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.0.291
3+
rev: v0.5.1
44
hooks:
55
- id: ruff
66
args:
77
- --fix
88
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v4.4.0
9+
rev: v4.6.0
1010
hooks:
1111
- id: check-added-large-files
1212
- id: check-docstring-first

babel/plural.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,7 @@ def tokenize_rule(s: str) -> list[tuple[str, str]]:
360360
result.append((tok, match.group()))
361361
break
362362
else:
363-
raise RuleError('malformed CLDR pluralization rule. '
364-
'Got unexpected %r' % s[pos])
363+
raise RuleError(f"malformed CLDR pluralization rule. Got unexpected {s[pos]!r}")
365364
return result[::-1]
366365

367366

pyproject.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
[tool.ruff]
22
target-version = "py38"
3+
extend-exclude = [
4+
"tests/messages/data",
5+
]
6+
7+
[tool.ruff.lint]
38
select = [
49
"B",
510
"C",
@@ -16,9 +21,8 @@ ignore = [
1621
"E731", # Do not assign a lambda expression (we use them on purpose)
1722
"E741", # Ambiguous variable name
1823
"UP012", # "utf-8" is on purpose
24+
"UP031", # A bunch of places where % formatting is better
1925
]
20-
extend-exclude = [
21-
"tests/messages/data",
22-
]
23-
[tool.ruff.per-file-ignores]
26+
27+
[tool.ruff.lint.per-file-ignores]
2428
"scripts/import_cldr.py" = ["E402"]

tests/messages/test_setuptools_frontend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def test_extract_distutils_keyword_arg_388(kwarg, expected):
2626
# hence `--keyword ignored` will actually never end up in the output.
2727

2828
cmdline = (
29-
"extract_messages --no-default-keywords --keyword ignored --keyword '%s' "
30-
"--input-dirs . --output-file django233.pot --add-comments Bar,Foo" % kwarg
29+
f"extract_messages --no-default-keywords --keyword ignored --keyword '{kwarg}' "
30+
"--input-dirs . --output-file django233.pot --add-comments Bar,Foo"
3131
)
3232
d = Distribution(attrs={
3333
"cmdclass": setuptools_frontend.COMMANDS,

0 commit comments

Comments
 (0)