Skip to content

Commit 8c9f803

Browse files
committed
refactor: Also add the option to ignore missing type to the Sphinx parser
1 parent 41921c5 commit 8c9f803

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/griffe/_internal/docstrings/sphinx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ def _read_return(
366366
offset: int,
367367
parsed_values: _ParsedValues,
368368
*,
369+
warn_missing_types: bool = True,
369370
warnings: bool = True,
370371
**options: Any, # noqa: ARG001
371372
) -> int:
@@ -384,7 +385,7 @@ def _read_return(
384385
try:
385386
annotation = docstring.parent.annotation # type: ignore[union-attr]
386387
except AttributeError:
387-
if warnings:
388+
if warnings and warn_missing_types:
388389
docstring_warning(docstring, 0, f"No return type or annotation at '{parsed_directive.line}'")
389390
annotation = None
390391

0 commit comments

Comments
 (0)