Shrink mypy whitelist for `sphinx.ext.autodoc.directive` (#12602)

This commit is contained in:
danieleades 2024-07-20 20:03:50 +01:00 committed by GitHub
parent 4009fe0c8c
commit 4808041cc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -251,7 +251,6 @@ module = [
"sphinx.domains.cpp",
"sphinx.events",
"sphinx.ext.autodoc",
"sphinx.ext.autodoc.directive",
"sphinx.ext.autodoc.importer",
"sphinx.ext.autosummary.generate",
"sphinx.ext.doctest",

View File

@ -31,14 +31,14 @@ AUTODOC_EXTENDABLE_OPTIONS = ['members', 'private-members', 'special-members',
'exclude-members']
class DummyOptionSpec(dict):
class DummyOptionSpec(dict[str, Callable[[str], str]]):
"""An option_spec allows any options."""
def __bool__(self) -> bool:
"""Behaves like some options are defined."""
return True
def __getitem__(self, key: str) -> Callable[[str], str]:
def __getitem__(self, _key: str) -> Callable[[str], str]:
return lambda x: x
@ -56,8 +56,9 @@ class DocumenterBridge:
self.state = state
def process_documenter_options(documenter: type[Documenter], config: Config, options: dict,
) -> Options:
def process_documenter_options(
documenter: type[Documenter], config: Config, options: dict[str, str],
) -> Options:
"""Recognize options of Documenter from user input."""
default_options = config.autodoc_default_options
for name in AUTODOC_DEFAULT_OPTIONS: