repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.0.291
+ rev: v0.5.1
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.4.0
+ rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
result.append((tok, match.group()))
break
else:
- raise RuleError('malformed CLDR pluralization rule. '
- 'Got unexpected %r' % s[pos])
+ raise RuleError(f"malformed CLDR pluralization rule. Got unexpected {s[pos]!r}")
return result[::-1]
[tool.ruff]
target-version = "py38"
+extend-exclude = [
+ "tests/messages/data",
+]
+
+[tool.ruff.lint]
select = [
"B",
"C",
"E731", # Do not assign a lambda expression (we use them on purpose)
"E741", # Ambiguous variable name
"UP012", # "utf-8" is on purpose
+ "UP031", # A bunch of places where % formatting is better
]
-extend-exclude = [
- "tests/messages/data",
-]
-[tool.ruff.per-file-ignores]
+
+[tool.ruff.lint.per-file-ignores]
"scripts/import_cldr.py" = ["E402"]
# hence `--keyword ignored` will actually never end up in the output.
cmdline = (
- "extract_messages --no-default-keywords --keyword ignored --keyword '%s' "
- "--input-dirs . --output-file django233.pot --add-comments Bar,Foo" % kwarg
+ f"extract_messages --no-default-keywords --keyword ignored --keyword '{kwarg}' "
+ "--input-dirs . --output-file django233.pot --add-comments Bar,Foo"
)
d = Distribution(attrs={
"cmdclass": setuptools_frontend.COMMANDS,