Skip to content

Commit 3e6a36c

Browse files
committed
please all checkers
1 parent d26802f commit 3e6a36c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sphinx_autodoc_typehints/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,29 +156,29 @@ def format_annotation(
156156
args_format = f"\\[:py:data:`{prefix}typing.Union`\\[{{}}]]"
157157
args = tuple(x for x in args if x is not type(None)) # noqa: E721
158158
elif full_name == "typing.Callable" and args and args[0] is not ...:
159-
formatted_args = [
159+
fmt = [
160160
format_annotation(
161161
arg,
162162
simplify_optional_unions=simplify_optional_unions,
163163
typehints_formatter=typehints_formatter,
164164
)
165165
for arg in args
166166
]
167-
formatted_args = f"\\[\\[{', '.join(formatted_args[:-1])}], {formatted_args[-1]}]"
167+
formatted_args = f"\\[\\[{', '.join(fmt[:-1])}], {fmt[-1]}]"
168168
elif full_name == "typing.Literal":
169169
formatted_args = f"\\[{', '.join(repr(arg) for arg in args)}]"
170170

171171
if args and not formatted_args:
172-
fmt = ", ".join(
172+
fmt = [
173173
format_annotation(
174174
arg,
175175
fully_qualified=fully_qualified,
176176
simplify_optional_unions=simplify_optional_unions,
177177
typehints_formatter=typehints_formatter,
178178
)
179179
for arg in args
180-
)
181-
formatted_args = args_format.format(fmt)
180+
]
181+
formatted_args = args_format.format(", ".join(fmt))
182182

183183
return f":py:{role}:`{prefix}{full_name}`{formatted_args}"
184184

0 commit comments

Comments
 (0)