diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab578e3a..72eec5ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.0.272" + rev: "v0.0.275" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -19,7 +19,7 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "0.12.0" + rev: "0.12.1" hooks: - id: pyproject-fmt additional_dependencies: ["tox>=4.6"] diff --git a/src/sphinx_autodoc_typehints/__init__.py b/src/sphinx_autodoc_typehints/__init__.py index c59610ab..83448536 100644 --- a/src/sphinx_autodoc_typehints/__init__.py +++ b/src/sphinx_autodoc_typehints/__init__.py @@ -150,8 +150,7 @@ def get_annotation_args(annotation: Any, module: str, class_name: str) -> tuple[ return annotation.__parameters__ # type: ignore[no-any-return] result = getattr(annotation, "__args__", ()) # 3.10 and earlier Tuple[()] returns ((), ) instead of () the tuple does - result = () if len(result) == 1 and result[0] == () else result # type: ignore[misc] - return result + return () if len(result) == 1 and result[0] == () else result # type: ignore[misc] def format_internal_tuple(t: tuple[Any, ...], config: Config) -> str: