Skip to content

Commit 5090486

Browse files
authored
Merge pull request #10741 from danieleades/fix-formatting
fix formatting
2 parents cdde699 + 964fcb2 commit 5090486

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

doc/development/tutorials/examples/recipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def get_full_qualified_name(self, node):
121121

122122
def get_objects(self):
123123
for obj in self.data['recipes']:
124-
yield(obj)
124+
yield obj
125125

126126
def resolve_xref(self, env, fromdocname, builder, typ, target, node,
127127
contnode):

sphinx/ext/napoleon/docstring.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ def lines(self) -> List[str]:
248248
def _consume_indented_block(self, indent: int = 1) -> List[str]:
249249
lines = []
250250
line = self._lines.get(0)
251-
while(not self._is_section_break() and
252-
(not line or self._is_indented(line, indent))):
251+
while (
252+
not self._is_section_break() and
253+
(not line or self._is_indented(line, indent))
254+
):
253255
lines.append(self._lines.next())
254256
line = self._lines.get(0)
255257
return lines

sphinx/util/typing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def is_invalid_builtin_class(obj: Any) -> bool:
7272
def get_type_hints(
7373
obj: Any, globalns: Optional[Dict[str, Any]] = None, localns: Optional[Dict] = None
7474
) -> Dict[str, Any]:
75-
"""Return a dictionary containing type hints for a function, method, module or class object.
75+
"""Return a dictionary containing type hints for a function, method, module or class
76+
object.
7677
7778
This is a simple wrapper of `typing.get_type_hints()` that does not raise an error on
7879
runtime.

tests/test_build_latex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ def test_latex_labels(app, status, warning):
15191519
def test_latex_figure_in_admonition(app, status, warning):
15201520
app.builder.build_all()
15211521
result = (app.outdir / 'python.tex').read_text(encoding='utf8')
1522-
assert(r'\begin{figure}[H]' in result)
1522+
assert r'\begin{figure}[H]' in result
15231523

15241524

15251525
def test_default_latex_documents():

tests/test_ext_napoleon.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ def test_add_config_values(self):
9595
for name in Config._config_values:
9696
has_config = False
9797
for method_name, args, _kwargs in app.method_calls:
98-
if(method_name == 'add_config_value' and
99-
args[0] == name):
98+
if (
99+
method_name == 'add_config_value' and
100+
args[0] == name
101+
):
100102
has_config = True
101103
if not has_config:
102104
self.fail('Config value was not added to app %s' % name)
@@ -105,11 +107,15 @@ def test_add_config_values(self):
105107
has_skip_member = False
106108
for method_name, args, _kwargs in app.method_calls:
107109
if method_name == 'connect':
108-
if(args[0] == 'autodoc-process-docstring' and
109-
args[1] == _process_docstring):
110+
if (
111+
args[0] == 'autodoc-process-docstring' and
112+
args[1] == _process_docstring
113+
):
110114
has_process_docstring = True
111-
elif(args[0] == 'autodoc-skip-member' and
112-
args[1] == _skip_member):
115+
elif (
116+
args[0] == 'autodoc-skip-member' and
117+
args[1] == _skip_member
118+
):
113119
has_skip_member = True
114120
if not has_process_docstring:
115121
self.fail('autodoc-process-docstring never connected')

0 commit comments

Comments
 (0)