Reformatted to latest stable black style

pull/406/head
Ashley Whetter 4 months ago
parent 61c52e0664
commit bbb50f68ae

@ -41,7 +41,6 @@ class AutoapiSummary(Autosummary):
class NestedParse(Directive):
"""Nested parsing to remove the first heading of included rST
This is used to handle the case where we like to remove user supplied

@ -2,6 +2,7 @@
This extension allows you to automagically generate API documentation from your project.
"""
import io
import os
import shutil

@ -20,7 +20,6 @@ Path = namedtuple("Path", ["absolute", "relative"])
class PythonMapperBase:
"""Base object for JSON -> Python object mapping.
Subclasses of this object will handle their language specific JSON input,
@ -163,7 +162,6 @@ class PythonMapperBase:
class SphinxMapperBase:
"""Base class for mapping `PythonMapperBase` objects to Sphinx.
Args:

@ -216,7 +216,6 @@ def _link_objs(value):
class PythonSphinxMapper(SphinxMapperBase):
"""Auto API domain handler for Python
Parses directly from Python files.

@ -0,0 +1 @@
Reformatted to latest stable black style.

@ -51,26 +51,21 @@ mixed_list: List[Union[str, int]] = [1, "two", 3]
"This is mixed"
def f2(not_yet_a: "A") -> int:
...
def f2(not_yet_a: "A") -> int: ...
def f3(imported: B) -> B:
...
def f3(imported: B) -> B: ...
class MyGeneric(Generic[T, U]):
...
class MyGeneric(Generic[T, U]): ...
@overload
def overloaded_func(a: float) -> float:
...
def overloaded_func(a: float) -> float: ...
@typing.overload
def overloaded_func(a: str) -> str:
...
def overloaded_func(a: str) -> str: ...
def overloaded_func(a: Union[float, str]) -> Union[float, str]:
@ -79,8 +74,7 @@ def overloaded_func(a: Union[float, str]) -> Union[float, str]:
@overload
def undoc_overloaded_func(a: str) -> str:
...
def undoc_overloaded_func(a: str) -> str: ...
def undoc_overloaded_func(a: str) -> str:
@ -112,33 +106,28 @@ class A:
return "method"
@overload
def overloaded_method(self, a: float) -> float:
...
def overloaded_method(self, a: float) -> float: ...
@typing.overload
def overloaded_method(self, a: str) -> str:
...
def overloaded_method(self, a: str) -> str: ...
def overloaded_method(self, a: Union[float, str]) -> Union[float, str]:
"""Overloaded method"""
return a * 2
@overload
def undoc_overloaded_method(self, a: float) -> float:
...
def undoc_overloaded_method(self, a: float) -> float: ...
def undoc_overloaded_method(self, a: float) -> float:
return a * 2
@typing.overload
@classmethod
def overloaded_class_method(cls, a: float) -> float:
...
def overloaded_class_method(cls, a: float) -> float: ...
@overload
@classmethod
def overloaded_class_method(cls, a: str) -> str:
...
def overloaded_class_method(cls, a: str) -> str: ...
@classmethod
def overloaded_class_method(cls, a: Union[float, str]) -> Union[float, str]:
@ -148,23 +137,18 @@ class A:
class C:
@overload
def __init__(self, a: int) -> None:
...
def __init__(self, a: int) -> None: ...
@typing.overload
def __init__(self, a: float) -> None:
...
def __init__(self, a: float) -> None: ...
def __init__(self, a: str):
...
def __init__(self, a: str): ...
class D(C):
class Da:
...
class Da: ...
class DB(Da):
...
class DB(Da): ...
...
@ -184,5 +168,4 @@ async def async_function(wait: bool) -> int:
global_a: A = A()
class SomeMetaclass(type):
...
class SomeMetaclass(type): ...

@ -26,12 +26,15 @@ class Foo(object):
def foo():
"""The foo class method"""
...
def __init__(self, attr):
"""Constructor docstring"""
...
def method_okay(self, foo=None, bar=None):
"""This method should parse okay"""
...
def method_multiline(self, foo=None, bar=None, baz=None):
"""This is on multiple lines, but should parse okay too
@ -39,4 +42,5 @@ class Foo(object):
definitions are covered in the way we're anticipating here
"""
...
def method_without_docstring(self): ...

@ -1,4 +1,5 @@
"""This is a docstring."""
from . import foo

Loading…
Cancel
Save