chore: lint source code using Ruff

This commit is contained in:
jakob.scheid committed 2026-09-21 20:10:09 +02:00
1 parent aa4a139878
commit de3eac3bb1
35 files changed
+161 -130

No files matched your search

+1 -2
View File
@@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from . import cli
from . import languages
from . import cli, languages
from .cli import main
__all__ = [
+2 -1
View File
@@ -19,6 +19,7 @@ The command line interface
import argparse
import pathlib
import sys
from .languages.python import VALID_SECTIONS as VALID_PYTHON_SECTIONS
__all__ = [
@@ -169,7 +170,7 @@ def main(argv=None) -> int:
except SyntaxError:
# TODO: add a custom exception class to clearify that a project
# parsing syntax error is meant.
return error(f'syntax error in project source code')
return error('syntax error in project source code')
except KeyboardInterrupt:
return 130
except BrokenPipeError:
+5 -5
View File
@@ -13,11 +13,11 @@
# limitations under the License.
import pathlib
from ...core.python import (
PythonDefinitionDocumentationIncludeSections,
PythonDocumentationGenerator,
)
from typing import Optional
__all__ = [
'VALID_SECTIONS',
@@ -31,7 +31,7 @@ VALID_SECTIONS = list(
def parse_sections_list(
include_sections: Optional[list[str]] = None,
include_sections: list[str] | None = None,
exclude_sections: list[str] = [],
) -> PythonDefinitionDocumentationIncludeSections:
"""
@@ -41,7 +41,7 @@ def parse_sections_list(
the section name.
:param include_sections: The list of sections to be included.
:type include_sections: Optional[list[str]]
:type include_sections: list[str] | None
:param exclude_sections: The list of sections to be excluded.
:type exclude_sections: list[str]
@@ -110,7 +110,7 @@ def generate(
project_directory: pathlib.Path,
output_directory: pathlib.Path,
*,
include_sections: Optional[list[str]] = None,
include_sections: list[str] | None = None,
exclude_sections: list[str] = [],
allow_html: bool = False,
allow_tables: bool = False,
@@ -124,7 +124,7 @@ def generate(
:type output_directory: pathlib.Path
:param include_sections: The sections to be included in the
documentation.
:type include_sections: Optional[list[str]]
:type include_sections: list[str] | None
:param exclude_sections: The sections to be excluded in the
documentation.
:type exclude_sections: list[str]