mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Shrink mypy whitelist for `sphinx.ext.autodoc.directive
` (#12602)
This commit is contained in:
parent
4009fe0c8c
commit
4808041cc9
@ -251,7 +251,6 @@ module = [
|
|||||||
"sphinx.domains.cpp",
|
"sphinx.domains.cpp",
|
||||||
"sphinx.events",
|
"sphinx.events",
|
||||||
"sphinx.ext.autodoc",
|
"sphinx.ext.autodoc",
|
||||||
"sphinx.ext.autodoc.directive",
|
|
||||||
"sphinx.ext.autodoc.importer",
|
"sphinx.ext.autodoc.importer",
|
||||||
"sphinx.ext.autosummary.generate",
|
"sphinx.ext.autosummary.generate",
|
||||||
"sphinx.ext.doctest",
|
"sphinx.ext.doctest",
|
||||||
|
@ -31,14 +31,14 @@ AUTODOC_EXTENDABLE_OPTIONS = ['members', 'private-members', 'special-members',
|
|||||||
'exclude-members']
|
'exclude-members']
|
||||||
|
|
||||||
|
|
||||||
class DummyOptionSpec(dict):
|
class DummyOptionSpec(dict[str, Callable[[str], str]]):
|
||||||
"""An option_spec allows any options."""
|
"""An option_spec allows any options."""
|
||||||
|
|
||||||
def __bool__(self) -> bool:
|
def __bool__(self) -> bool:
|
||||||
"""Behaves like some options are defined."""
|
"""Behaves like some options are defined."""
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def __getitem__(self, key: str) -> Callable[[str], str]:
|
def __getitem__(self, _key: str) -> Callable[[str], str]:
|
||||||
return lambda x: x
|
return lambda x: x
|
||||||
|
|
||||||
|
|
||||||
@ -56,8 +56,9 @@ class DocumenterBridge:
|
|||||||
self.state = state
|
self.state = state
|
||||||
|
|
||||||
|
|
||||||
def process_documenter_options(documenter: type[Documenter], config: Config, options: dict,
|
def process_documenter_options(
|
||||||
) -> Options:
|
documenter: type[Documenter], config: Config, options: dict[str, str],
|
||||||
|
) -> Options:
|
||||||
"""Recognize options of Documenter from user input."""
|
"""Recognize options of Documenter from user input."""
|
||||||
default_options = config.autodoc_default_options
|
default_options = config.autodoc_default_options
|
||||||
for name in AUTODOC_DEFAULT_OPTIONS:
|
for name in AUTODOC_DEFAULT_OPTIONS:
|
||||||
|
Loading…
Reference in New Issue
Block a user