style: limit line length to 79 characters

Limited the lengths of all lines to 79 characters (if possible).
Additionally, some other lines were breaked for consistence.
This commit is contained in:
jakob.scheid committed 2026-09-18 16:57:45 +02:00
1 parent 8930efc7e6
commit caa8e04047
25 files changed
+6726 -1071

No files matched your search

+20 -5
View File
@@ -35,7 +35,9 @@ def existing_directory(path: str) -> pathlib.Path:
_path = path
path = pathlib.Path(_path)
if not path.exists():
raise argparse.ArgumentTypeError(f'{_path}: no such file or directory')
raise argparse.ArgumentTypeError(
f'{_path}: no such file or directory'
)
if not path.is_dir():
raise argparse.ArgumentTypeError(f'{_path}: not a directory')
return path
@@ -79,7 +81,10 @@ def create_argument_parser() -> argparse.ArgumentParser:
argument_parser = argparse.ArgumentParser()
subparsers = argument_parser.add_subparsers(dest = 'language', required = True)
subparsers = argument_parser.add_subparsers(
dest = 'language',
required = True
)
python_parser = subparsers.add_parser(
_LANG_PYTHON,
@@ -99,19 +104,29 @@ def create_argument_parser() -> argparse.ArgumentParser:
nargs = '+',
default = [],
choices = VALID_PYTHON_SECTIONS,
help = 'the sections to be excluded in the documentation. If a section shall be included AND excluded, it is excluded.'
help = (
'the sections to be excluded in the documentation. '
'If a section shall be included AND excluded, it is excluded.'
)
)
python_parser.add_argument(
'-H',
'--allow-html',
action = 'store_true',
help = 'indicates whether HTML is allowed in the documentation. By default, HTML is disabled.'
help = (
'indicates whether HTML is allowed in the documentation. '
'By default, HTML is disabled.'
)
)
python_parser.add_argument(
'-T',
'--allow-tables',
action = 'store_true',
help = 'indicates whether Markdown tables are allowed in the documentation. By default, Markdown tables are disabled. Warning: Markdown tables are not CommonMark.'
help = (
'indicates whether Markdown tables are allowed in the '
'documentation. By default, Markdown tables are disabled. '
'Warning: Markdown tables are not CommonMark.'
)
)
return argument_parser
+14 -4
View File
@@ -13,7 +13,10 @@
# limitations under the License.
import pathlib
from ...core.python import PythonDefinitionDocumentationIncludeSections, PythonDocumentationGenerator
from ...core.python import (
PythonDefinitionDocumentationIncludeSections,
PythonDocumentationGenerator
)
from typing import Optional
__all__ = [
@@ -22,9 +25,14 @@ __all__ = [
'generate'
]
VALID_SECTIONS = list(PythonDefinitionDocumentationIncludeSections()._args.keys())
VALID_SECTIONS = list(
PythonDefinitionDocumentationIncludeSections()._args.keys()
)
def parse_sections_list(include_sections: Optional[list[str]] = None, exclude_sections: list[str] = []) -> PythonDefinitionDocumentationIncludeSections:
def parse_sections_list(
include_sections: Optional[list[str]] = None,
exclude_sections: list[str] = []
) -> PythonDefinitionDocumentationIncludeSections:
'''
Returns a Python definition documentation sections list from the
sections list to be included and the sections list to be excluded.
@@ -63,7 +71,9 @@ def _generate(
project_directory: pathlib.Path,
output_directory: pathlib.Path,
*,
include_sections: PythonDefinitionDocumentationIncludeSections = PythonDefinitionDocumentationIncludeSections(),
include_sections: PythonDefinitionDocumentationIncludeSections = (
PythonDefinitionDocumentationIncludeSections()
),
allow_html: bool = False,
allow_tables: bool = False
) -> None: