From 58a0190eab88b13fdbb6526a671d45a63834f1a2 Mon Sep 17 00:00:00 2001 From: gschwaer <3410079+gschwaer@users.noreply.github.com> Date: Mon, 29 Nov 2021 19:55:58 +0100 Subject: [PATCH] docs: add new option to documentation --- CHANGES | 2 ++ doc/usage/extensions/autodoc.rst | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 4c11f90f723..3044f5f06ec 100644 --- a/CHANGES +++ b/CHANGES @@ -47,6 +47,8 @@ Features added * #9695: More CSS classes on Javascript domain descriptions * #9683: Revert the removal of ``add_stylesheet()`` API. It will be kept until the Sphinx-6.0 release +* #9792: autodoc: Add new option for ``autodoc_typehints_description_target`` to + include undocumented return values but not undocumented parameters. Bugs fixed ---------- diff --git a/doc/usage/extensions/autodoc.rst b/doc/usage/extensions/autodoc.rst index 5ac3cd17179..fe4318c9c62 100644 --- a/doc/usage/extensions/autodoc.rst +++ b/doc/usage/extensions/autodoc.rst @@ -622,8 +622,16 @@ There are also config values that you can set: When set to ``"documented"``, types will only be documented for a parameter or a return value that is already documented by the docstring. + With ``"returnvalue_and_documented_params"``, parameter types will only be + annotated if the parameter is documented in the docstring. The return type is + always annotated (except if it is ``None``). + .. versionadded:: 4.0 + .. versionadded:: 4.3 + + New option ``'returnvalue_and_documented_params'`` is added. + .. confval:: autodoc_type_aliases A dictionary for users defined `type aliases`__ that maps a type name to the