mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove `sphinx.domains.{c,cpp}` from the no-any-generics whitelist
This commit is contained in:
@@ -229,13 +229,6 @@ module = [
|
||||
]
|
||||
strict_optional = false
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
"sphinx.domains.c",
|
||||
"sphinx.domains.cpp",
|
||||
]
|
||||
disallow_any_generics = false
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
"imagesize",
|
||||
|
||||
@@ -213,7 +213,7 @@ class CObject(ObjectDescription[ASTDeclaration]):
|
||||
return parser.parse_declaration(self.object_type, self.objtype)
|
||||
|
||||
def describe_signature(
|
||||
self, signode: TextElement, ast: ASTDeclaration, options: dict
|
||||
self, signode: TextElement, ast: ASTDeclaration, options: dict[str, Any]
|
||||
) -> None:
|
||||
ast.describe_signature(signode, 'lastIsName', self.env, options)
|
||||
|
||||
@@ -472,7 +472,7 @@ class AliasNode(nodes.Element):
|
||||
def __init__(
|
||||
self,
|
||||
sig: str,
|
||||
aliasOptions: dict,
|
||||
aliasOptions: dict[str, bool],
|
||||
document: Any,
|
||||
env: BuildEnvironment | None = None,
|
||||
parentKey: LookupKey | None = None,
|
||||
@@ -509,8 +509,8 @@ class AliasTransform(SphinxTransform):
|
||||
s: Symbol,
|
||||
maxdepth: int,
|
||||
skip_this: bool,
|
||||
alias_options: dict,
|
||||
render_options: dict,
|
||||
alias_options: dict[str, bool],
|
||||
render_options: dict[str, bool],
|
||||
document: Any,
|
||||
) -> list[Node]:
|
||||
if maxdepth == 0:
|
||||
@@ -629,7 +629,7 @@ class AliasTransform(SphinxTransform):
|
||||
node.replace_self(nodes)
|
||||
|
||||
|
||||
class CAliasObject(ObjectDescription):
|
||||
class CAliasObject(ObjectDescription[str]):
|
||||
option_spec: ClassVar[OptionSpec] = {
|
||||
'maxdepth': directives.nonnegative_int,
|
||||
'noroot': directives.flag,
|
||||
|
||||
@@ -304,7 +304,7 @@ class CPPObject(ObjectDescription[ASTDeclaration]):
|
||||
return parser.parse_declaration(self.object_type, self.objtype)
|
||||
|
||||
def describe_signature(
|
||||
self, signode: desc_signature, ast: ASTDeclaration, options: dict
|
||||
self, signode: desc_signature, ast: ASTDeclaration, options: dict[str, Any]
|
||||
) -> None:
|
||||
ast.describe_signature(signode, 'lastIsName', self.env, options)
|
||||
|
||||
@@ -621,7 +621,7 @@ class AliasNode(nodes.Element):
|
||||
def __init__(
|
||||
self,
|
||||
sig: str,
|
||||
aliasOptions: dict,
|
||||
aliasOptions: dict[str, bool],
|
||||
env: BuildEnvironment | None = None,
|
||||
parentKey: LookupKey | None = None,
|
||||
) -> None:
|
||||
@@ -653,8 +653,8 @@ class AliasTransform(SphinxTransform):
|
||||
s: Symbol,
|
||||
maxdepth: int,
|
||||
skip_this: bool,
|
||||
alias_options: dict,
|
||||
render_options: dict,
|
||||
alias_options: dict[str, bool],
|
||||
render_options: dict[str, bool],
|
||||
document: Any,
|
||||
) -> list[Node]:
|
||||
if maxdepth == 0:
|
||||
@@ -799,7 +799,7 @@ class AliasTransform(SphinxTransform):
|
||||
node.replace_self(nodes)
|
||||
|
||||
|
||||
class CPPAliasObject(ObjectDescription):
|
||||
class CPPAliasObject(ObjectDescription[str]):
|
||||
option_spec: ClassVar[OptionSpec] = {
|
||||
'maxdepth': directives.nonnegative_int,
|
||||
'noroot': directives.flag,
|
||||
|
||||
Reference in New Issue
Block a user