🔧 Update ruff v0.4.4 (#12375)

This commit is contained in:
Chris Sewell 2024-05-15 07:00:55 +02:00 committed by GitHub
parent 92b30c26e0
commit 71d50a8658
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 4 deletions

View File

@ -83,7 +83,7 @@ docs = [
] ]
lint = [ lint = [
"flake8>=3.5.0", "flake8>=3.5.0",
"ruff==0.4.1", "ruff==0.4.4",
"mypy==1.10.0", "mypy==1.10.0",
"sphinx-lint", "sphinx-lint",
"types-docutils", "types-docutils",

View File

@ -108,7 +108,7 @@ class ImageCollector(EnvironmentCollector):
logger.warning(__('image file %s not readable: %s'), filename, err, logger.warning(__('image file %s not readable: %s'), filename, err,
location=node, type='image', subtype='not_readable') location=node, type='image', subtype='not_readable')
for key, files in globbed.items(): for key, files in globbed.items():
candidates[key] = sorted(files, key=len)[0] # select by similarity candidates[key] = min(files, key=len) # select by similarity
class DownloadFileCollector(EnvironmentCollector): class DownloadFileCollector(EnvironmentCollector):

View File

@ -364,9 +364,9 @@ class Locale(SphinxTransform):
for node, msg in extract_messages(self.document): for node, msg in extract_messages(self.document):
msgstr = merged.get(msg, '') msgstr = merged.get(msg, '')
# There is no point in having #noqa on literal blocks because # There is no point in having noqa on literal blocks because
# they cannot contain references. Recognizing it would just # they cannot contain references. Recognizing it would just
# completely prevent escaping the #noqa. Outside of literal # completely prevent escaping the noqa. Outside of literal
# blocks, one can always write \#noqa. # blocks, one can always write \#noqa.
if not isinstance(node, LITERAL_TYPE_NODES): if not isinstance(node, LITERAL_TYPE_NODES):
msgstr, _ = parse_noqa(msgstr) msgstr, _ = parse_noqa(msgstr)

View File

@ -53,3 +53,12 @@ deps =
bindep bindep
commands = commands =
bindep test bindep test
[testenv:ruff]
description =
Run ruff formatting and linting.
extras =
lint
commands =
ruff format .
ruff check --fix .