Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#423)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 30, 2024
1 parent d2955c6 commit d810826
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/tox-dev/tox-ini-fmt
Expand Down
1 change: 1 addition & 0 deletions src/sphinx_autodoc_typehints/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx autodoc type hints."""

from __future__ import annotations

import ast
Expand Down
1 change: 1 addition & 0 deletions src/sphinx_autodoc_typehints/attributes_patch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Patch for attributes."""

from __future__ import annotations

from functools import partial
Expand Down
1 change: 1 addition & 0 deletions src/sphinx_autodoc_typehints/patches.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom patches to make the world work."""

from __future__ import annotations

from functools import lru_cache
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module demonstrating imports that are type guarded"""

from __future__ import annotations

import datetime
Expand Down
4 changes: 2 additions & 2 deletions tests/roots/test-resolve-typing-guard/demo_typing_guard.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module demonstrating imports that are type guarded"""

from __future__ import annotations

import typing
Expand Down Expand Up @@ -54,8 +55,7 @@ def guarded(self, item: Decimal) -> None:
"""


def func(_x: Literal) -> None:
...
def func(_x: Literal) -> None: ...


__all__ = [
Expand Down
6 changes: 2 additions & 4 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,13 +625,11 @@ def func_with_examples() -> int:


@overload
def func_with_overload(a: int, b: int) -> None:
...
def func_with_overload(a: int, b: int) -> None: ...


@overload
def func_with_overload(a: str, b: str) -> None:
...
def func_with_overload(a: str, b: str) -> None: ...


@expected(
Expand Down
12 changes: 4 additions & 8 deletions tests/test_sphinx_autodoc_typehints.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,17 @@ class A:
def get_type(self) -> type:
return type(self)

class Inner:
...
class Inner: ...


class B(Generic[T]):
name = "Foo" # This is set to make sure the correct class name ("B") is picked up


class C(B[str]):
...
class C(B[str]): ...


class D(typing_extensions.Protocol):
...
class D(typing_extensions.Protocol): ...


class E(typing_extensions.Protocol[T]): # type: ignore[misc]
Expand All @@ -104,8 +101,7 @@ class Slotted:
__slots__ = ()


class Metaclass(type):
...
class Metaclass(type): ...


class HintedMethods:
Expand Down

0 comments on commit d810826

Please sign in to comment.