generated from jCloud/repository-template
style: remove trailing whitespace
Removed all trailing whitespace.
This commit is contained in:
8 files changed
+28
-28
No files matched your search
@@ -149,7 +149,7 @@ def _signature_argument_list(
|
|||||||
|
|
||||||
for arg in positional_only_args:
|
for arg in positional_only_args:
|
||||||
args.append(arg.signature_repr())
|
args.append(arg.signature_repr())
|
||||||
|
|
||||||
if positional_only_args:
|
if positional_only_args:
|
||||||
args.append('/')
|
args.append('/')
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ def _signature_argument_list(
|
|||||||
|
|
||||||
for arg in keyword_only_args:
|
for arg in keyword_only_args:
|
||||||
args.append(arg.signature_repr())
|
args.append(arg.signature_repr())
|
||||||
|
|
||||||
if kwargs is not None:
|
if kwargs is not None:
|
||||||
args.append(kwargs.signature_repr())
|
args.append(kwargs.signature_repr())
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ def _markdown_table(
|
|||||||
) -> str:
|
) -> str:
|
||||||
'''
|
'''
|
||||||
Generates a table.
|
Generates a table.
|
||||||
|
|
||||||
If ``allow_markdown_table`` is ``False``, an alternative
|
If ``allow_markdown_table`` is ``False``, an alternative
|
||||||
representation is used.
|
representation is used.
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ def _markdown_table(
|
|||||||
|
|
||||||
if not header or not body:
|
if not header or not body:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
header_len = len(header)
|
header_len = len(header)
|
||||||
|
|
||||||
if allow_markdown_table:
|
if allow_markdown_table:
|
||||||
@@ -593,7 +593,7 @@ class PythonDefinitionDocumentationGenerator:
|
|||||||
md += self.definition.doc.docstring
|
md += self.definition.doc.docstring
|
||||||
elif not self.skip_empty_sections:
|
elif not self.skip_empty_sections:
|
||||||
md += 'There is no docstring to show.'
|
md += 'There is no docstring to show.'
|
||||||
|
|
||||||
if _is_docstring(self.definition.doc) or not self.skip_empty_sections:
|
if _is_docstring(self.definition.doc) or not self.skip_empty_sections:
|
||||||
if self.allow_html:
|
if self.allow_html:
|
||||||
md += '</details>'
|
md += '</details>'
|
||||||
@@ -859,10 +859,10 @@ class PythonDefinitionDocumentationGenerator:
|
|||||||
if isinstance(self.definition, PythonClassDefinition):
|
if isinstance(self.definition, PythonClassDefinition):
|
||||||
if self.include_sections.bases:
|
if self.include_sections.bases:
|
||||||
md += self._generate_bases_section() + '\n\n'
|
md += self._generate_bases_section() + '\n\n'
|
||||||
|
|
||||||
if self.include_sections.class_body:
|
if self.include_sections.class_body:
|
||||||
md += self._generate_body_section() + '\n\n'
|
md += self._generate_body_section() + '\n\n'
|
||||||
|
|
||||||
if self.include_sections.decorators:
|
if self.include_sections.decorators:
|
||||||
md += self._generate_decorators_section() + '\n\n'
|
md += self._generate_decorators_section() + '\n\n'
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class PythonFunctionArgument:
|
|||||||
'invalid identifier',
|
'invalid identifier',
|
||||||
identifier = name
|
identifier = name
|
||||||
)
|
)
|
||||||
|
|
||||||
# check whether the annotation is a valid annotation
|
# check whether the annotation is a valid annotation
|
||||||
# Currently, it is only checked whether the parameter is not
|
# Currently, it is only checked whether the parameter is not
|
||||||
# empty.
|
# empty.
|
||||||
@@ -84,7 +84,7 @@ class PythonFunctionArgument:
|
|||||||
self.kind = kind
|
self.kind = kind
|
||||||
self.default = default
|
self.default = default
|
||||||
self.annotation = annotation
|
self.annotation = annotation
|
||||||
|
|
||||||
if self.kind in (
|
if self.kind in (
|
||||||
PythonArgumentKind.VARARG,
|
PythonArgumentKind.VARARG,
|
||||||
PythonArgumentKind.KWARGS
|
PythonArgumentKind.KWARGS
|
||||||
@@ -103,7 +103,7 @@ class PythonFunctionArgument:
|
|||||||
and self.default == value.default
|
and self.default == value.default
|
||||||
and self.annotation == value.annotation
|
and self.annotation == value.annotation
|
||||||
)
|
)
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return type(self).__name__ + repr((
|
return type(self).__name__ + repr((
|
||||||
self.name,
|
self.name,
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class PythonDefinition:
|
|||||||
_python_docstring(ast.get_docstring(node)),
|
_python_docstring(ast.get_docstring(node)),
|
||||||
[ast.unparse(d) for d in node.decorator_list]
|
[ast.unparse(d) for d in node.decorator_list]
|
||||||
)
|
)
|
||||||
|
|
||||||
def __eq__(self, value: object) -> bool:
|
def __eq__(self, value: object) -> bool:
|
||||||
if not isinstance(value, PythonDefinition):
|
if not isinstance(value, PythonDefinition):
|
||||||
return False
|
return False
|
||||||
@@ -224,7 +224,7 @@ class PythonClassDefinition(PythonDefinition):
|
|||||||
self.decorators,
|
self.decorators,
|
||||||
self.body
|
self.body
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_node(cls, node: ast.stmt) -> PythonClassDefinition:
|
def from_node(cls, node: ast.stmt) -> PythonClassDefinition:
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ __all__ = [
|
|||||||
class PythonDocstring:
|
class PythonDocstring:
|
||||||
'''
|
'''
|
||||||
Represents a Python docstring.
|
Represents a Python docstring.
|
||||||
|
|
||||||
:param docstring: The docstring as a string.
|
:param docstring: The docstring as a string.
|
||||||
:type docstring: str
|
:type docstring: str
|
||||||
'''
|
'''
|
||||||
@@ -32,12 +32,12 @@ class PythonDocstring:
|
|||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return type(self).__name__ + '(' + repr(self.docstring) + ')'
|
return type(self).__name__ + '(' + repr(self.docstring) + ')'
|
||||||
|
|
||||||
def __eq__(self, value) -> bool:
|
def __eq__(self, value) -> bool:
|
||||||
if not isinstance(value, type(self)):
|
if not isinstance(value, type(self)):
|
||||||
return False
|
return False
|
||||||
return self.docstring == value.docstring
|
return self.docstring == value.docstring
|
||||||
|
|
||||||
def parse(self) -> docstring_parser.Docstring:
|
def parse(self) -> docstring_parser.Docstring:
|
||||||
'''
|
'''
|
||||||
Parses the docstring.
|
Parses the docstring.
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class PythonPackageNamespace(PythonNamespace):
|
|||||||
'''
|
'''
|
||||||
Returns the names of all sub-namespaces of the specified package
|
Returns the names of all sub-namespaces of the specified package
|
||||||
namespace and keeps the package structure.
|
namespace and keeps the package structure.
|
||||||
|
|
||||||
:param package: The package.
|
:param package: The package.
|
||||||
:type package: PythonPackageNamespace
|
:type package: PythonPackageNamespace
|
||||||
|
|
||||||
@@ -134,12 +134,12 @@ class PythonPackageNamespace(PythonNamespace):
|
|||||||
)
|
)
|
||||||
for sn in package._sub_namespaces
|
for sn in package._sub_namespaces
|
||||||
}
|
}
|
||||||
|
|
||||||
def sub_namespace_names(self) -> PythonPackageNamespaceDictType:
|
def sub_namespace_names(self) -> PythonPackageNamespaceDictType:
|
||||||
'''
|
'''
|
||||||
Returns the names of all sub-namespaces and keeps the package
|
Returns the names of all sub-namespaces and keeps the package
|
||||||
structure.
|
structure.
|
||||||
|
|
||||||
:return: The names if all sub-namespaces.
|
:return: The names if all sub-namespaces.
|
||||||
:rtype: PythonPackageNamespaceDictType
|
:rtype: PythonPackageNamespaceDictType
|
||||||
'''
|
'''
|
||||||
@@ -179,7 +179,7 @@ class PythonPackageNamespace(PythonNamespace):
|
|||||||
'no such namespace',
|
'no such namespace',
|
||||||
namespace_identifier = name
|
namespace_identifier = name
|
||||||
)
|
)
|
||||||
|
|
||||||
def add(self, namespace: PythonNamespace) -> None:
|
def add(self, namespace: PythonNamespace) -> None:
|
||||||
'''
|
'''
|
||||||
Adds a namespace.
|
Adds a namespace.
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class NamespaceError(ValueError):
|
|||||||
if self.args[0]
|
if self.args[0]
|
||||||
else ""
|
else ""
|
||||||
}'
|
}'
|
||||||
|
|
||||||
class InvalidNamespaceError(NamespaceError): ...
|
class InvalidNamespaceError(NamespaceError): ...
|
||||||
class NamespaceNotFoundError(NamespaceError): ...
|
class NamespaceNotFoundError(NamespaceError): ...
|
||||||
class NamespaceExistsError(NamespaceError): ...
|
class NamespaceExistsError(NamespaceError): ...
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class ExistingFile(pathlib.Path):
|
|||||||
def _quote(string: str, quotation_mark: str) -> str:
|
def _quote(string: str, quotation_mark: str) -> str:
|
||||||
'''
|
'''
|
||||||
Quotes a string.
|
Quotes a string.
|
||||||
|
|
||||||
:param string: The string to quote
|
:param string: The string to quote
|
||||||
:type string: str
|
:type string: str
|
||||||
:param quotation_mark: The quotation mark
|
:param quotation_mark: The quotation mark
|
||||||
@@ -98,7 +98,7 @@ def human_readable_list(
|
|||||||
:type final_separator: str
|
:type final_separator: str
|
||||||
:param quotation_mark: The characters that are inserted before and
|
:param quotation_mark: The characters that are inserted before and
|
||||||
after an element. Default is ''.
|
after an element. Default is ''.
|
||||||
|
|
||||||
:return: The human-readable list.
|
:return: The human-readable list.
|
||||||
:rtype: str
|
:rtype: str
|
||||||
'''
|
'''
|
||||||
@@ -106,11 +106,11 @@ def human_readable_list(
|
|||||||
# empty list
|
# empty list
|
||||||
if not ls:
|
if not ls:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
# list with one element
|
# list with one element
|
||||||
if len(ls) == 1:
|
if len(ls) == 1:
|
||||||
return _quote(str(ls[0]), quotation_mark)
|
return _quote(str(ls[0]), quotation_mark)
|
||||||
|
|
||||||
return ', '.join(
|
return ', '.join(
|
||||||
[
|
[
|
||||||
_quote(
|
_quote(
|
||||||
@@ -165,7 +165,7 @@ def assert_that_is_instance(
|
|||||||
obj
|
obj
|
||||||
).__name__}\''
|
).__name__}\''
|
||||||
)
|
)
|
||||||
|
|
||||||
def non_empty_str(value: Union[str, None]) -> Union[str, None]:
|
def non_empty_str(value: Union[str, None]) -> Union[str, None]:
|
||||||
'''
|
'''
|
||||||
Returns the value or ``None``.
|
Returns the value or ``None``.
|
||||||
@@ -184,7 +184,7 @@ def non_empty_str(value: Union[str, None]) -> Union[str, None]:
|
|||||||
|
|
||||||
if value is None:
|
if value is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if value.strip() == '':
|
if value.strip() == '':
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -75,14 +75,14 @@ class Something:
|
|||||||
"""A class."""
|
"""A class."""
|
||||||
def __init__(self, value: typing.Any = 42) -> None:
|
def __init__(self, value: typing.Any = 42) -> None:
|
||||||
self._value = value
|
self._value = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def value(self) -> typing.Any:
|
def value(self) -> typing.Any:
|
||||||
"""
|
"""
|
||||||
The value.
|
The value.
|
||||||
"""
|
"""
|
||||||
return self.get_value()
|
return self.get_value()
|
||||||
|
|
||||||
def get_value(self) -> typing.Any:
|
def get_value(self) -> typing.Any:
|
||||||
"""
|
"""
|
||||||
Returns the value.
|
Returns the value.
|
||||||
|
|||||||
Reference in new issue
Block a user