diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a36dfcb..ef2af79 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,12 +5,12 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.28.3 + rev: 0.28.4 hooks: - id: check-github-workflows args: [ "--verbose" ] - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell additional_dependencies: ["tomli>=2.0.1"] @@ -20,12 +20,12 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.1.1" + rev: "2.1.3" hooks: - id: pyproject-fmt additional_dependencies: ["tox>=4.14.2"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.4" + rev: "v0.4.7" hooks: - id: ruff-format - id: ruff diff --git a/pyproject.toml b/pyproject.toml index fe45afe..0665011 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,6 +80,16 @@ format.docstring-code-format = true lint.select = [ "ALL", ] +lint.ignore = [ + "ANN101", # no type annotation for self + "ANN401", # allow Any as type annotation + "COM812", # Conflict with formatter + "CPY", # No copyright statements + "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible + "D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible + "ISC001", # Conflict with formatter + "S104", # Possible binding to all interface +] lint.per-file-ignores."tests/**/*.py" = [ "D", # don't care about documentation in tests "FBT", # don"t care about booleans as positional arguments in tests @@ -97,16 +107,6 @@ lint.isort = { known-first-party = [ ], required-imports = [ "from __future__ import annotations", ] } -lint.ignore = [ - "ANN101", # no type annotation for self - "ANN401", # allow Any as type annotation - "COM812", # Conflict with formatter - "CPY", # No copyright statements - "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible - "D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible - "ISC001", # Conflict with formatter - "S104", # Possible binding to all interface -] lint.preview = true [tool.codespell] diff --git a/src/sphinx_autodoc_typehints/__init__.py b/src/sphinx_autodoc_typehints/__init__.py index b0e48bf..7cf8edd 100644 --- a/src/sphinx_autodoc_typehints/__init__.py +++ b/src/sphinx_autodoc_typehints/__init__.py @@ -491,7 +491,7 @@ def _get_type_hint(autodoc_mock_imports: list[str], name: str, obj: Any) -> dict return result -def backfill_type_hints(obj: Any, name: str) -> dict[str, Any]: # noqa: C901, PLR0911, PLR0912 +def backfill_type_hints(obj: Any, name: str) -> dict[str, Any]: # noqa: C901, PLR0911 """ Backfill type hints.