Skip to content

[pre-commit.ci] pre-commit autoupdate #423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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