Skip to content

Commit bbb50f6

Browse files
committed
Reformatted to latest stable black style
1 parent 61c52e0 commit bbb50f6

File tree

8 files changed

+24
-38
lines changed

8 files changed

+24
-38
lines changed

autoapi/directives.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def get_items(self, names):
4141

4242

4343
class NestedParse(Directive):
44-
4544
"""Nested parsing to remove the first heading of included rST
4645
4746
This is used to handle the case where we like to remove user supplied

autoapi/extension.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
This extension allows you to automagically generate API documentation from your project.
44
"""
5+
56
import io
67
import os
78
import shutil

autoapi/mappers/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121

2222
class PythonMapperBase:
23-
2423
"""Base object for JSON -> Python object mapping.
2524
2625
Subclasses of this object will handle their language specific JSON input,
@@ -163,7 +162,6 @@ def ref_directive(self):
163162

164163

165164
class SphinxMapperBase:
166-
167165
"""Base class for mapping `PythonMapperBase` objects to Sphinx.
168166
169167
Args:

autoapi/mappers/python/mapper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def _link_objs(value):
216216

217217

218218
class PythonSphinxMapper(SphinxMapperBase):
219-
220219
"""Auto API domain handler for Python
221220
222221
Parses directly from Python files.

docs/changes/+af2042c3.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reformatted to latest stable black style.

tests/python/py3example/example/example.py

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,21 @@ def f(start: int, end: int) -> Iterable[int]:
5151
"This is mixed"
5252

5353

54-
def f2(not_yet_a: "A") -> int:
55-
...
54+
def f2(not_yet_a: "A") -> int: ...
5655

5756

58-
def f3(imported: B) -> B:
59-
...
57+
def f3(imported: B) -> B: ...
6058

6159

62-
class MyGeneric(Generic[T, U]):
63-
...
60+
class MyGeneric(Generic[T, U]): ...
6461

6562

6663
@overload
67-
def overloaded_func(a: float) -> float:
68-
...
64+
def overloaded_func(a: float) -> float: ...
6965

7066

7167
@typing.overload
72-
def overloaded_func(a: str) -> str:
73-
...
68+
def overloaded_func(a: str) -> str: ...
7469

7570

7671
def overloaded_func(a: Union[float, str]) -> Union[float, str]:
@@ -79,8 +74,7 @@ def overloaded_func(a: Union[float, str]) -> Union[float, str]:
7974

8075

8176
@overload
82-
def undoc_overloaded_func(a: str) -> str:
83-
...
77+
def undoc_overloaded_func(a: str) -> str: ...
8478

8579

8680
def undoc_overloaded_func(a: str) -> str:
@@ -112,33 +106,28 @@ def my_method(self) -> str:
112106
return "method"
113107

114108
@overload
115-
def overloaded_method(self, a: float) -> float:
116-
...
109+
def overloaded_method(self, a: float) -> float: ...
117110

118111
@typing.overload
119-
def overloaded_method(self, a: str) -> str:
120-
...
112+
def overloaded_method(self, a: str) -> str: ...
121113

122114
def overloaded_method(self, a: Union[float, str]) -> Union[float, str]:
123115
"""Overloaded method"""
124116
return a * 2
125117

126118
@overload
127-
def undoc_overloaded_method(self, a: float) -> float:
128-
...
119+
def undoc_overloaded_method(self, a: float) -> float: ...
129120

130121
def undoc_overloaded_method(self, a: float) -> float:
131122
return a * 2
132123

133124
@typing.overload
134125
@classmethod
135-
def overloaded_class_method(cls, a: float) -> float:
136-
...
126+
def overloaded_class_method(cls, a: float) -> float: ...
137127

138128
@overload
139129
@classmethod
140-
def overloaded_class_method(cls, a: str) -> str:
141-
...
130+
def overloaded_class_method(cls, a: str) -> str: ...
142131

143132
@classmethod
144133
def overloaded_class_method(cls, a: Union[float, str]) -> Union[float, str]:
@@ -148,23 +137,18 @@ def overloaded_class_method(cls, a: Union[float, str]) -> Union[float, str]:
148137

149138
class C:
150139
@overload
151-
def __init__(self, a: int) -> None:
152-
...
140+
def __init__(self, a: int) -> None: ...
153141

154142
@typing.overload
155-
def __init__(self, a: float) -> None:
156-
...
143+
def __init__(self, a: float) -> None: ...
157144

158-
def __init__(self, a: str):
159-
...
145+
def __init__(self, a: str): ...
160146

161147

162148
class D(C):
163-
class Da:
164-
...
149+
class Da: ...
165150

166-
class DB(Da):
167-
...
151+
class DB(Da): ...
168152

169153
...
170154

@@ -184,5 +168,4 @@ async def async_function(wait: bool) -> int:
184168
global_a: A = A()
185169

186170

187-
class SomeMetaclass(type):
188-
...
171+
class SomeMetaclass(type): ...

tests/python/pyiexample/example/example.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,21 @@ class Foo(object):
2626
def foo():
2727
"""The foo class method"""
2828
...
29+
2930
def __init__(self, attr):
3031
"""Constructor docstring"""
3132
...
33+
3234
def method_okay(self, foo=None, bar=None):
3335
"""This method should parse okay"""
3436
...
37+
3538
def method_multiline(self, foo=None, bar=None, baz=None):
3639
"""This is on multiple lines, but should parse okay too
3740
3841
pydocstyle gives us lines of source. Test if this means that multiline
3942
definitions are covered in the way we're anticipating here
4043
"""
4144
...
45+
4246
def method_without_docstring(self): ...

tests/python/pypackageexample/example/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This is a docstring."""
2+
23
from . import foo
34

45

0 commit comments

Comments
 (0)