From 8107a807a38d118afcf74537f58e9db23bf6a3c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 15:15:19 -0700 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#364) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- src/sphinx_autodoc_typehints/__init__.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) 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: