diff --git a/pyproject.toml b/pyproject.toml index c7c116083b..d356f0003e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -302,56 +302,45 @@ include = [ "tests", "utils", ] +exclude = [ + "tests/roots", +] reportArgumentType = "none" reportAssignmentType = "none" reportAttributeAccessIssue = "none" reportCallIssue = "none" reportConstantRedefinition = "none" -reportDeprecated = "none" reportGeneralTypeIssues = "none" reportIncompatibleMethodOverride = "none" reportIncompatibleVariableOverride = "none" -reportInconsistentOverload = "none" reportIndexIssue = "none" -reportInvalidTypeArguments = "none" reportInvalidTypeForm = "none" -reportInvalidTypeVarUse = "none" reportMissingImports = "none" reportMissingModuleSource = "none" reportMissingParameterType = "none" reportMissingTypeArgument = "none" reportMissingTypeStubs = "none" reportOperatorIssue = "none" -reportOptionalIterable = "none" reportOptionalMemberAccess = "none" -reportOptionalOperand = "none" reportOptionalSubscript = "none" reportPossiblyUnboundVariable = "none" reportPrivateUsage = "none" reportRedeclaration = "none" reportReturnType = "none" -reportSelfClsParameterName = "none" -reportTypeCommentUsage = "none" -reportTypedDictNotRequiredAccess = "none" -reportUndefinedVariable = "none" reportUnknownArgumentType = "none" reportUnknownLambdaType = "none" reportUnknownMemberType = "none" reportUnknownParameterType = "none" reportUnknownVariableType = "none" reportUnnecessaryComparison = "none" -reportUnnecessaryContains = "none" reportUnnecessaryIsInstance = "none" -reportUnsupportedDunderAll = "none" reportUntypedBaseClass = "none" -reportUntypedFunctionDecorator = "none" reportUntypedNamedTuple = "none" reportUnusedClass = "none" reportUnusedFunction = "none" reportUnusedImport = "none" reportUnusedVariable = "none" -reportWildcardImportFromLibrary = "none" [tool.uv] default-groups = "all" diff --git a/sphinx/domains/cpp/_ast.py b/sphinx/domains/cpp/_ast.py index 6d88c94f17..d66a28ba21 100644 --- a/sphinx/domains/cpp/_ast.py +++ b/sphinx/domains/cpp/_ast.py @@ -4459,6 +4459,7 @@ class ASTTemplateDeclarationPrefix(ASTBase): lineSpec: bool, ) -> None: verify_description_mode(mode) + assert self.templates is not None for t in self.templates: t.describe_signature_as_introducer( signode, 'lastIsName', env, symbol, lineSpec diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index 4c5accfb6f..546a292f83 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -817,7 +817,7 @@ def _evaluate_forwardref( # before 3.12.4 still has the old signature). # # See: https://github.com/python/cpython/pull/118104. - return ref._evaluate( + return ref._evaluate( # pyright: ignore[reportDeprecated] globalns, localns, type_params=(), recursive_guard=frozenset() ) # type: ignore[call-arg] return ref._evaluate(globalns, localns, recursive_guard=frozenset()) diff --git a/sphinx/writers/texinfo.py b/sphinx/writers/texinfo.py index 0731f16873..e70f8e4f0a 100644 --- a/sphinx/writers/texinfo.py +++ b/sphinx/writers/texinfo.py @@ -1173,7 +1173,7 @@ class TexinfoTranslator(SphinxTranslator): def visit_topic(self, node: Element) -> None: # ignore TOC's since we have to have a "menu" anyway - if 'contents' in node.get('classes', ()): + if (classes := node.get('classes', ())) and 'contents' in classes: raise nodes.SkipNode title = cast('nodes.title', node[0]) self.visit_rubric(title) diff --git a/tests/test_config/test_config.py b/tests/test_config/test_config.py index 3d608a7d2f..68eb8cedd2 100644 --- a/tests/test_config/test_config.py +++ b/tests/test_config/test_config.py @@ -52,7 +52,8 @@ def test_is_serializable() -> None: subject = [1, [2, {3, 'a'}], {'x': {'y': frozenset((4, 5))}}] check_is_serializable(subject, circular=False) - a, b = [1], [2] # type: (CircularList, CircularList) + a: CircularList = [1] + b: CircularList = [2] a.append(b) b.append(a) check_is_serializable(a, circular=True) @@ -139,7 +140,8 @@ def test_config_pickle_protocol(protocol: int) -> None: def test_config_pickle_circular_reference_in_list(): - a, b = [1], [2] # type: (CircularList, CircularList) + a: CircularList = [1] + b: CircularList = [2] a.append(b) b.append(a) @@ -184,9 +186,9 @@ def test_config_pickle_circular_reference_in_list(): u: list[list[object] | int], v: list[list[object] | int], *, - counter: Counter[type, int] | None = None, + counter: Counter[type] | None = None, guard: frozenset[int] = frozenset(), - ) -> Counter[type, int]: + ) -> Counter[type]: counter = Counter() if counter is None else counter if id(u) in guard and id(v) in guard: @@ -248,7 +250,7 @@ def test_config_pickle_circular_reference_in_dict(): u: dict[str, dict[str, object] | int], v: dict[str, dict[str, object] | int], *, - counter: Counter[type, int] | None = None, + counter: Counter[type] | None = None, guard: frozenset[int] = frozenset(), ) -> Counter: counter = Counter() if counter is None else counter diff --git a/tests/test_util/typing_test_data.py b/tests/test_util/typing_test_data.py index 5b34111c02..f46717000e 100644 --- a/tests/test_util/typing_test_data.py +++ b/tests/test_util/typing_test_data.py @@ -16,7 +16,7 @@ T_co = TypeVar('T_co', covariant=True) T_contra = TypeVar('T_contra', contravariant=True) -def f2(x: List[T], y: List[T_co], z: T) -> List[T_contra]: +def f2(x: List[T], y: List[T_co], z: T) -> List[T_contra]: # pyright: ignore[reportInvalidTypeVarUse] pass