Skip to content

Commit 85b7c7f

Browse files
authored
autodoc: Fix default option parsing (#14198)
1 parent 93b20c4 commit 85b7c7f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Bugs fixed
2626
Patch by Adam Turner
2727
* Fix tests for Python 3.15.
2828
Patch by Adam Turner
29+
* #14089: autodoc: Fix default option parsing.
30+
Patch by Adam Turner
2931

3032
Testing
3133
-------

sphinx/ext/autodoc/_directive_options.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ def merge_members_option(options: dict[str, Any]) -> None:
275275
'private-members': members_option,
276276
'special-members': members_option,
277277
'member-order': member_order_option,
278-
'show-inheritance': bool_option,
279278
}
280279
_OPTION_SPEC_MODULE_SPECIFIC: Final[OptionSpec] = {
281280
'ignore-module-all': bool_option,
@@ -286,6 +285,7 @@ def merge_members_option(options: dict[str, Any]) -> None:
286285
}
287286
_OPTION_SPEC_CLASS_SPECIFIC: Final[OptionSpec] = {
288287
'class-doc-from': class_doc_from_option,
288+
'show-inheritance': bool_option,
289289
'inherited-members': inherited_members_option,
290290
}
291291
_OPTION_SPEC_ASSIGNMENT: Final[OptionSpec] = _OPTION_SPEC_COMMON | {
@@ -299,7 +299,9 @@ def merge_members_option(options: dict[str, Any]) -> None:
299299
_OPTION_SPECS: Final[Mapping[_AutodocObjType, OptionSpec]] = {
300300
'module': _OPTION_SPEC_HAS_MEMBERS
301301
| _OPTION_SPEC_MODULE_SPECIFIC
302+
| {'show-inheritance': bool_option} # special case
302303
| {'inherited-members': inherited_members_option} # special case
304+
| {'no-value': bool_option} # special case
303305
| _OPTION_SPEC_DEPRECATED,
304306
'class': _OPTION_SPEC_HAS_MEMBERS
305307
| _OPTION_SPEC_CLASS_SPECIFIC

0 commit comments

Comments
 (0)