style: remove trailing whitespace

Removed all trailing whitespace.
This commit is contained in:
jakob.scheid committed 2026-09-18 17:02:09 +02:00
1 parent caa8e04047
commit 23e450e9df
8 files changed
+28 -28

No files matched your search

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