Skip to content

Commit

Permalink
🔧 Update ruff v0.4.4 (#12375)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed May 15, 2024
1 parent 92b30c2 commit 71d50a8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ docs = [
]
lint = [
"flake8>=3.5.0",
"ruff==0.4.1",
"ruff==0.4.4",
"mypy==1.10.0",
"sphinx-lint",
"types-docutils",
Expand Down
2 changes: 1 addition & 1 deletion sphinx/environment/collectors/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def collect_candidates(self, env: BuildEnvironment, imgpath: str,
logger.warning(__('image file %s not readable: %s'), filename, err,
location=node, type='image', subtype='not_readable')
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):
Expand Down
4 changes: 2 additions & 2 deletions sphinx/transforms/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ def apply(self, **kwargs: Any) -> None:
for node, msg in extract_messages(self.document):
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
# completely prevent escaping the #noqa. Outside of literal
# completely prevent escaping the noqa. Outside of literal
# blocks, one can always write \#noqa.
if not isinstance(node, LITERAL_TYPE_NODES):
msgstr, _ = parse_noqa(msgstr)
Expand Down
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,12 @@ deps =
bindep
commands =
bindep test

[testenv:ruff]
description =
Run ruff formatting and linting.
extras =
lint
commands =
ruff format .
ruff check --fix .

0 comments on commit 71d50a8

Please sign in to comment.