Skip to content

Commit d1bc461

Browse files
committed
Run ruff format
1 parent b528120 commit d1bc461

File tree

5 files changed

+19
-23
lines changed

5 files changed

+19
-23
lines changed

sphinx/writers/latex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ def depart_admonition(self, node: Element) -> None:
17981798
def _visit_named_admonition(self, node: Element) -> None:
17991799
label = admonitionlabels[node.tagname]
18001800
self.body.append(
1801-
CR + fr'\begin{{sphinxadmonition}}{{{node.tagname}}}{{{label}:}}'
1801+
CR + rf'\begin{{sphinxadmonition}}{{{node.tagname}}}{{{label}:}}'
18021802
)
18031803
self.no_latex_floats += 1
18041804

sphinx/writers/texinfo.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,11 @@ def init_settings(self) -> None:
252252
'(%s)' % elements['filename'],
253253
self.escape_arg(self.settings.texinfo_dir_description),
254254
)
255-
elements['direntry'] = '@dircategory {}\n@direntry\n{}@end direntry\n'.format(
256-
self.escape_id(self.settings.texinfo_dir_category),
257-
entry,
255+
elements['direntry'] = (
256+
'@dircategory {}\n@direntry\n{}@end direntry\n'.format(
257+
self.escape_id(self.settings.texinfo_dir_category),
258+
entry,
259+
)
258260
)
259261
elements['copying'] = COPYING % elements
260262
# allow the user to override them all

tests/test_ext_autodoc/test_ext_autodoc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,8 +2190,7 @@ def test_autodoc_GenericAlias() -> None:
21902190
'',
21912191
' A list of Class',
21922192
'',
2193-
' alias of :py:class:`list`\\ '
2194-
'[:py:class:`~target.genericalias.Class`]',
2193+
' alias of :py:class:`list`\\ [:py:class:`~target.genericalias.Class`]',
21952194
'',
21962195
'',
21972196
'.. py:data:: T',

tests/test_util/test_util_inspect.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ def test_signature_annotations() -> None:
314314

315315
# Callable types
316316
sig = inspect.signature(mod.f8)
317-
assert stringify_signature(sig) == '(x: collections.abc.Callable[[int, str], int]) -> None'
317+
assert (
318+
stringify_signature(sig)
319+
== '(x: collections.abc.Callable[[int, str], int]) -> None'
320+
)
318321

319322
sig = inspect.signature(mod.f9)
320323
assert stringify_signature(sig) == '(x: collections.abc.Callable) -> None'
@@ -360,9 +363,7 @@ def test_signature_annotations() -> None:
360363
assert stringify_signature(sig) == '(*, arg3, arg4)'
361364

362365
sig = inspect.signature(mod.f18)
363-
assert stringify_signature(sig) == (
364-
'(self, arg1: int | tuple = 10) -> list[dict]'
365-
)
366+
assert stringify_signature(sig) == ('(self, arg1: int | tuple = 10) -> list[dict]')
366367

367368
# annotations for variadic and keyword parameters
368369
sig = inspect.signature(mod.f19)

tests/test_util/test_util_typing.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,15 @@ def test_restify_type_hints_containers():
232232
':py:class:`dict`\\ [:py:class:`str`, :py:class:`float`]'
233233
)
234234
assert restify(tuple[str, str, str]) == (
235-
':py:class:`tuple`\\ '
236-
'[:py:class:`str`, :py:class:`str`, '
237-
':py:class:`str`]'
235+
':py:class:`tuple`\\ [:py:class:`str`, :py:class:`str`, :py:class:`str`]'
238236
)
239237
ann_rst = restify(tuple[str, ...])
240238
assert ann_rst == ':py:class:`tuple`\\ [:py:class:`str`, ...]'
241239

242240
assert restify(tuple[()]) == ':py:class:`tuple`\\ [()]'
243241

244242
assert restify(list[dict[str, tuple]]) == (
245-
':py:class:`list`\\ '
246-
'[:py:class:`dict`\\ '
247-
'[:py:class:`str`, :py:class:`tuple`]]'
243+
':py:class:`list`\\ [:py:class:`dict`\\ [:py:class:`str`, :py:class:`tuple`]]'
248244
)
249245
assert restify(MyList[tuple[int, int]]) == (
250246
':py:class:`tests.test_util.test_util_typing.MyList`\\ '
@@ -595,7 +591,9 @@ def test_stringify_type_hints_containers():
595591
assert ann_str == 'tuple[str, ...]'
596592
assert stringify_annotation(tuple[str, ...], 'smart') == 'tuple[str, ...]'
597593

598-
assert stringify_annotation(tuple[()], 'fully-qualified-except-typing') == 'tuple[()]'
594+
assert (
595+
stringify_annotation(tuple[()], 'fully-qualified-except-typing') == 'tuple[()]'
596+
)
599597
assert stringify_annotation(tuple[()], 'fully-qualified') == 'tuple[()]'
600598
assert stringify_annotation(tuple[()], 'smart') == 'tuple[()]'
601599

@@ -613,13 +611,9 @@ def test_stringify_type_hints_containers():
613611
)
614612
assert ann_str == 'tests.test_util.test_util_typing.MyList[tuple[int, int]]'
615613
ann_str = stringify_annotation(MyList[tuple[int, int]], 'fully-qualified')
616-
assert ann_str == (
617-
'tests.test_util.test_util_typing.MyList[tuple[int, int]]'
618-
)
614+
assert ann_str == ('tests.test_util.test_util_typing.MyList[tuple[int, int]]')
619615
ann_str = stringify_annotation(MyList[tuple[int, int]], 'smart')
620-
assert ann_str == (
621-
'~tests.test_util.test_util_typing.MyList[tuple[int, int]]'
622-
)
616+
assert ann_str == ('~tests.test_util.test_util_typing.MyList[tuple[int, int]]')
623617

624618
ann_str = stringify_annotation(
625619
t.Generator[None, None, None], 'fully-qualified-except-typing'

0 commit comments

Comments
 (0)