From e01447a5980ca2c6e94c93f8df7618deb59d627a Mon Sep 17 00:00:00 2001 From: Marco Ricci Date: Sun, 8 Sep 2024 12:29:36 +0200 Subject: [PATCH] chore: fix linting errors --- src/_griffe/docstrings/google.py | 36 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/_griffe/docstrings/google.py b/src/_griffe/docstrings/google.py index 4ecf2338..91238c38 100644 --- a/src/_griffe/docstrings/google.py +++ b/src/_griffe/docstrings/google.py @@ -461,7 +461,6 @@ def _get_name_annotation_description( lines: list[str], *, named: bool = True, - **options: Any, ) -> tuple[str | None, Any, str]: if named: match = _RE_NAME_ANNOTATION_DESCRIPTION.match(lines[0]) @@ -505,7 +504,6 @@ def _maybe_destructure_annotation( index: int, *, multiple: bool = True, - **options: Any, ) -> Any: if isinstance(annotation, ExprName): return annotation @@ -525,13 +523,19 @@ def _read_returns_section( returns = [] block, new_offset = _read_block_items_maybe( - docstring, offset=offset, multiple=returns_multiple_items, **options + docstring, + offset=offset, + multiple=returns_multiple_items, + **options, ) for index, (line_number, return_lines) in enumerate(block): try: name, annotation, description = _get_name_annotation_description( - docstring, line_number, return_lines, named=returns_named_value + docstring, + line_number, + return_lines, + named=returns_named_value, ) except ValueError: continue @@ -550,7 +554,9 @@ def _read_returns_section( raise ValueError orig_annotation = annotation annotation = _maybe_destructure_annotation( - annotation, index, multiple=returns_multiple_items + annotation, + index, + multiple=returns_multiple_items, ) if annotation == orig_annotation: annotation = _maybe_destructure_annotation( @@ -579,13 +585,19 @@ def _read_yields_section( yields = [] block, new_offset = _read_block_items_maybe( - docstring, offset=offset, multiple=returns_multiple_items, **options + docstring, + offset=offset, + multiple=returns_multiple_items, + **options, ) for index, (line_number, yield_lines) in enumerate(block): try: name, annotation, description = _get_name_annotation_description( - docstring, line_number, yield_lines, named=returns_named_value + docstring, + line_number, + yield_lines, + named=returns_named_value, ) except ValueError: continue @@ -623,13 +635,19 @@ def _read_receives_section( receives = [] block, new_offset = _read_block_items_maybe( - docstring, offset=offset, multiple=receives_multiple_items, **options + docstring, + offset=offset, + multiple=receives_multiple_items, + **options, ) for index, (line_number, receive_lines) in enumerate(block): try: name, annotation, description = _get_name_annotation_description( - docstring, line_number, receive_lines, named=receives_named_value + docstring, + line_number, + receive_lines, + named=receives_named_value, ) except ValueError: continue