Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
rev: "0.30.0"
hooks:
- id: check-github-workflows
args: ["--verbose"]
Expand All @@ -24,7 +24,7 @@ repos:
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.5"
rev: "v0.9.1"
hooks:
- id: ruff-format
- id: ruff
Expand Down
12 changes: 6 additions & 6 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ class Class:
:param z: baz
"""

def __init__(self, x: bool, y: int, z: Optional[str] = None) -> None: # noqa: UP007
def __init__(self, x: bool, y: int, z: Optional[str] = None) -> None: # noqa: UP045
pass

def a_method(self, x: bool, y: int, z: Optional[str] = None) -> str: # noqa: UP007
def a_method(self, x: bool, y: int, z: Optional[str] = None) -> str: # noqa: UP045
"""
Method docstring.

Expand Down Expand Up @@ -182,7 +182,7 @@ def __magic_custom_method__(self, x: str) -> str: # noqa: PLW3201
"""

@classmethod
def a_classmethod(cls, x: bool, y: int, z: Optional[str] = None) -> str: # noqa: UP007
def a_classmethod(cls, x: bool, y: int, z: Optional[str] = None) -> str: # noqa: UP045
"""
Classmethod docstring.

Expand All @@ -192,7 +192,7 @@ def a_classmethod(cls, x: bool, y: int, z: Optional[str] = None) -> str: # noqa
"""

@staticmethod
def a_staticmethod(x: bool, y: int, z: Optional[str] = None) -> str: # noqa: UP007
def a_staticmethod(x: bool, y: int, z: Optional[str] = None) -> str: # noqa: UP045
"""
Staticmethod docstring.

Expand Down Expand Up @@ -270,7 +270,7 @@ def __init__(self, message: str) -> None:
bytes
""",
)
def function(x: bool, y: int, z_: Optional[str] = None) -> str: # noqa: UP007
def function(x: bool, y: int, z_: Optional[str] = None) -> str: # noqa: UP045
"""
Function docstring.

Expand Down Expand Up @@ -675,7 +675,7 @@ class mod.TestClassAttributeDocs
class TestClassAttributeDocs:
"""A class"""

code: Optional[CodeType] # noqa: UP007
code: Optional[CodeType] # noqa: UP045
"""An attribute"""


Expand Down
4 changes: 2 additions & 2 deletions tests/test_sphinx_autodoc_typehints.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
id="Union-str-Any",
),
pytest.param(
Optional[str], # noqa: UP007
Optional[str], # noqa: UP045
r":py:data:`~typing.Optional`\ \[:py:class:`str`]",
id="Optional-str",
),
Expand All @@ -267,7 +267,7 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
id="Optional-str-None",
),
pytest.param(
Optional[str | bool], # noqa: UP007
Optional[str | bool], # noqa: UP045
r":py:data:`~typing.Union`\ \[:py:class:`str`, :py:class:`bool`, :py:obj:`None`]",
id="Optional-Union-str-bool",
),
Expand Down
Loading