style: ensure trailing commas in multi-line statements

This commit is contained in:
jakob.scheid committed 2026-09-18 22:18:13 +02:00
1 parent ffcc7404de
commit 475775eb7e
30 files changed
+1778 -1774

No files matched your search

+1 -1
View File
@@ -19,5 +19,5 @@ from .cli import main
__all__ = [
'cli',
'languages',
'main'
'main',
]
+10 -10
View File
@@ -25,7 +25,7 @@ __all__ = [
'existing_directory',
'error',
'create_argument_parser',
'main'
'main',
]
_LANG_PYTHON = 'python'
@@ -70,33 +70,33 @@ def create_argument_parser() -> argparse.ArgumentParser:
type = existing_directory,
nargs = '?',
default = pathlib.Path('.'),
help = 'The directory of the project'
help = 'The directory of the project',
)
common_parser.add_argument(
'-o',
'--output-dir',
type = pathlib.Path,
help = 'the output directory the documentation will be written to'
help = 'the output directory the documentation will be written to',
)
argument_parser = argparse.ArgumentParser()
subparsers = argument_parser.add_subparsers(
dest = 'language',
required = True
required = True,
)
python_parser = subparsers.add_parser(
_LANG_PYTHON,
parents = [common_parser],
help = 'generate documentation for Python project'
help = 'generate documentation for Python project',
)
python_parser.add_argument(
'-s',
'--sections',
nargs = '+',
choices = VALID_PYTHON_SECTIONS,
help = 'the sections to be included in the documentation'
help = 'the sections to be included in the documentation',
)
python_parser.add_argument(
'-S',
@@ -107,7 +107,7 @@ def create_argument_parser() -> argparse.ArgumentParser:
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',
@@ -116,7 +116,7 @@ def create_argument_parser() -> argparse.ArgumentParser:
help = (
'indicates whether HTML is allowed in the documentation. '
'By default, HTML is disabled.'
)
),
)
python_parser.add_argument(
'-T',
@@ -126,7 +126,7 @@ def create_argument_parser() -> argparse.ArgumentParser:
'indicates whether Markdown tables are allowed in the '
'documentation. By default, Markdown tables are disabled. '
'Warning: Markdown tables are not CommonMark.'
)
),
)
return argument_parser
@@ -147,7 +147,7 @@ def main(argv = None) -> int:
include_sections = args.sections,
exclude_sections = args.sections_exclude,
allow_html = args.allow_html,
allow_tables = args.allow_tables
allow_tables = args.allow_tables,
)
except FileNotFoundError as exc:
return error(f'{exc.filename}: no such file or directory')
+1 -1
View File
@@ -15,5 +15,5 @@
from . import python
__all__ = [
'python'
'python',
]
+8 -8
View File
@@ -15,14 +15,14 @@
import pathlib
from ...core.python import (
PythonDefinitionDocumentationIncludeSections,
PythonDocumentationGenerator
PythonDocumentationGenerator,
)
from typing import Optional
__all__ = [
'VALID_SECTIONS',
'parse_sections_list',
'generate'
'generate',
]
VALID_SECTIONS = list(
@@ -31,7 +31,7 @@ VALID_SECTIONS = list(
def parse_sections_list(
include_sections: Optional[list[str]] = None,
exclude_sections: list[str] = []
exclude_sections: list[str] = [],
) -> PythonDefinitionDocumentationIncludeSections:
'''
Returns a Python definition documentation sections list from the
@@ -64,7 +64,7 @@ def parse_sections_list(
docstring = 'docstring' in include_sections,
bases = 'bases' in include_sections,
decorators = 'decorators' in include_sections,
class_body = 'class_body' in include_sections
class_body = 'class_body' in include_sections,
)
def _generate(
@@ -75,7 +75,7 @@ def _generate(
PythonDefinitionDocumentationIncludeSections()
),
allow_html: bool = False,
allow_tables: bool = False
allow_tables: bool = False,
) -> None:
'''
Generates the documentation for a Python project.
@@ -99,7 +99,7 @@ def _generate(
output_directory,
include_sections = include_sections,
allow_html = allow_html,
allow_tables = allow_tables
allow_tables = allow_tables,
)
docs_generator.generate_documentation()
@@ -110,7 +110,7 @@ def generate(
include_sections: Optional[list[str]] = None,
exclude_sections: list[str] = [],
allow_html: bool = False,
allow_tables: bool = False
allow_tables: bool = False,
) -> None:
'''
Generates the documentation for a Python project.
@@ -139,5 +139,5 @@ def generate(
output_directory,
include_sections = sections,
allow_html = allow_html,
allow_tables = allow_tables
allow_tables = allow_tables,
)