Skip to content

Commit d0fa2bb

Browse files
[pre-commit.ci] pre-commit autoupdate (#472)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3c1773a commit d0fa2bb

10 files changed

+43
-43
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: 0.29.0
8+
rev: 0.29.2
99
hooks:
1010
- id: check-github-workflows
1111
args: [ "--verbose" ]
@@ -20,12 +20,12 @@ repos:
2020
- id: tox-ini-fmt
2121
args: ["-p", "fix"]
2222
- repo: https://github.com/tox-dev/pyproject-fmt
23-
rev: "2.1.4"
23+
rev: "2.2.1"
2424
hooks:
2525
- id: pyproject-fmt
2626
additional_dependencies: ["tox>=4.14.2"]
2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: "v0.5.4"
28+
rev: "v0.6.3"
2929
hooks:
3030
- id: ruff-format
3131
- id: ruff

tests/roots/test-dummy/dummy_module_future_annotations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33

44
def function_with_py310_annotations(
5-
self, # noqa: ANN001, ARG001
6-
x: bool | None, # noqa: ARG001
7-
y: int | str | float, # noqa: ARG001,PYI041
8-
z: str | None = None, # noqa: ARG001
5+
self, # noqa: ANN001
6+
x: bool | None,
7+
y: int | str | float, # noqa: PYI041
8+
z: str | None = None,
99
) -> str:
1010
"""
1111
Method docstring.

tests/roots/test-dummy/dummy_module_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33

4-
def function(x: bool, y: int = 1) -> str: # noqa: ARG001
4+
def function(x: bool, y: int = 1) -> str:
55
"""
66
Function docstring.
77

tests/roots/test-dummy/dummy_module_simple_default_role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33

4-
def function(x: bool, y: int) -> str: # noqa: ARG001
4+
def function(x: bool, y: int) -> str:
55
"""
66
Function docstring.
77

tests/roots/test-dummy/dummy_module_simple_no_use_rtype.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33

4-
def function_no_returns(x: bool, y: int = 1) -> str: # noqa: ARG001
4+
def function_no_returns(x: bool, y: int = 1) -> str:
55
"""
66
Function docstring.
77
@@ -10,7 +10,7 @@ def function_no_returns(x: bool, y: int = 1) -> str: # noqa: ARG001
1010
"""
1111

1212

13-
def function_returns_with_type(x: bool, y: int = 1) -> str: # noqa: ARG001
13+
def function_returns_with_type(x: bool, y: int = 1) -> str:
1414
"""
1515
Function docstring.
1616
@@ -20,7 +20,7 @@ def function_returns_with_type(x: bool, y: int = 1) -> str: # noqa: ARG001
2020
"""
2121

2222

23-
def function_returns_with_compound_type(x: bool, y: int = 1) -> str: # noqa: ARG001
23+
def function_returns_with_compound_type(x: bool, y: int = 1) -> str:
2424
"""
2525
Function docstring.
2626
@@ -30,7 +30,7 @@ def function_returns_with_compound_type(x: bool, y: int = 1) -> str: # noqa: AR
3030
"""
3131

3232

33-
def function_returns_without_type(x: bool, y: int = 1) -> str: # noqa: ARG001
33+
def function_returns_without_type(x: bool, y: int = 1) -> str:
3434
"""
3535
Function docstring.
3636

tests/roots/test-dummy/dummy_module_without_complete_typehints.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33

4-
def function_with_some_defaults_and_without_typehints(x, y=None): # noqa: ANN001, ANN201, ARG001
4+
def function_with_some_defaults_and_without_typehints(x, y=None): # noqa: ANN001, ANN201
55
"""
66
Function docstring.
77
@@ -10,7 +10,7 @@ def function_with_some_defaults_and_without_typehints(x, y=None): # noqa: ANN00
1010
"""
1111

1212

13-
def function_with_some_defaults_and_some_typehints(x: int, y=None): # noqa: ANN001, ANN201, ARG001
13+
def function_with_some_defaults_and_some_typehints(x: int, y=None): # noqa: ANN001, ANN201
1414
"""
1515
Function docstring.
1616
@@ -19,7 +19,7 @@ def function_with_some_defaults_and_some_typehints(x: int, y=None): # noqa: ANN
1919
"""
2020

2121

22-
def function_with_some_defaults_and_more_typehints(x: int, y=None) -> str: # noqa: ANN001, ARG001
22+
def function_with_some_defaults_and_more_typehints(x: int, y=None) -> str: # noqa: ANN001
2323
"""
2424
Function docstring.
2525
@@ -28,7 +28,7 @@ def function_with_some_defaults_and_more_typehints(x: int, y=None) -> str: # no
2828
"""
2929

3030

31-
def function_with_defaults_and_some_typehints(x: int = 0, y=None) -> str: # noqa: ANN001, ARG001
31+
def function_with_defaults_and_some_typehints(x: int = 0, y=None) -> str: # noqa: ANN001
3232
"""
3333
Function docstring.
3434

tests/test_integration.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def dec(val: T) -> T:
5050

5151
@expected("mod.get_local_function()")
5252
def get_local_function(): # noqa: ANN201
53-
def wrapper(self) -> str: # noqa: ANN001, ARG001
53+
def wrapper(self) -> str: # noqa: ANN001
5454
"""
5555
Wrapper
5656
"""
@@ -271,7 +271,7 @@ def __init__(self, message: str) -> None:
271271
bytes
272272
""",
273273
)
274-
def function(x: bool, y: int, z_: Optional[str] = None) -> str: # noqa: ARG001, UP007
274+
def function(x: bool, y: int, z_: Optional[str] = None) -> str: # noqa: UP007
275275
"""
276276
Function docstring.
277277
@@ -299,7 +299,7 @@ def function(x: bool, y: int, z_: Optional[str] = None) -> str: # noqa: ARG001,
299299
* ****kwargs** ("str") -- bar
300300
""",
301301
)
302-
def function_with_starred_documentation_param_names(*args: int, **kwargs: str): # noqa: ANN201, ARG001
302+
def function_with_starred_documentation_param_names(*args: int, **kwargs: str): # noqa: ANN201
303303
r"""
304304
Function docstring.
305305
@@ -322,7 +322,7 @@ def function_with_starred_documentation_param_names(*args: int, **kwargs: str):
322322
**x** ("str") -- foo
323323
""",
324324
)
325-
def function_with_escaped_default(x: str = "\b"): # noqa: ANN201, ARG001
325+
def function_with_escaped_default(x: str = "\b"): # noqa: ANN201
326326
"""
327327
Function docstring.
328328
@@ -341,7 +341,7 @@ def function_with_escaped_default(x: str = "\b"): # noqa: ANN201, ARG001
341341
**x** (a.b.c) -- foo
342342
""",
343343
)
344-
def function_with_unresolvable_annotation(x: a.b.c): # noqa: ANN201, ARG001, F821
344+
def function_with_unresolvable_annotation(x: a.b.c): # noqa: ANN201, F821
345345
"""
346346
Function docstring.
347347
@@ -365,8 +365,8 @@ def function_with_unresolvable_annotation(x: a.b.c): # noqa: ANN201, ARG001, F8
365365
""",
366366
)
367367
def function_with_typehint_comment( # noqa: ANN201
368-
x, # type: int # noqa: ANN001, ARG001
369-
y, # type: str # noqa: ANN001, ARG001
368+
x, # type: int # noqa: ANN001
369+
y, # type: str # noqa: ANN001
370370
):
371371
# type: (...) -> None
372372
"""
@@ -457,7 +457,7 @@ def method_without_typehint(self, x): # noqa: ANN001, ANN201, ARG002, PLR6301
457457
"None"
458458
""",
459459
)
460-
def function_with_typehint_comment_not_inline(x=None, *y, z, **kwargs): # noqa: ANN001, ANN002, ANN003, ANN201, ARG001
460+
def function_with_typehint_comment_not_inline(x=None, *y, z, **kwargs): # noqa: ANN001, ANN002, ANN003, ANN201
461461
# type: (Union[str, bytes, None], *str, bytes, **int) -> None
462462
"""
463463
Function docstring.
@@ -592,7 +592,7 @@ def __init__(self, func: Callable[[int, str], str]) -> None:
592592
**x** ("Mailbox") -- function
593593
""",
594594
)
595-
def mocked_import(x: Mailbox): # noqa: ANN201, ARG001
595+
def mocked_import(x: Mailbox): # noqa: ANN201
596596
"""
597597
A docstring.
598598
@@ -648,7 +648,7 @@ def func_with_overload(a: str, b: str) -> None: ...
648648
"None"
649649
""",
650650
)
651-
def func_with_overload(a: Union[int, str], b: Union[int, str]) -> None: # noqa: ARG001, UP007
651+
def func_with_overload(a: Union[int, str], b: Union[int, str]) -> None: # noqa: UP007
652652
"""
653653
f does the thing. The arguments can either be ints or strings but they must
654654
both have the same type.
@@ -727,7 +727,7 @@ def func_with_examples_and_returns_after() -> int:
727727
More info about the function here.
728728
""",
729729
)
730-
def func_with_parameters_and_stuff_after(a: int, b: int) -> int: # noqa: ARG001
730+
def func_with_parameters_and_stuff_after(a: int, b: int) -> int:
731731
"""A func
732732
733733
:param a: a tells us something
@@ -761,7 +761,7 @@ def func_with_parameters_and_stuff_after(a: int, b: int) -> int: # noqa: ARG001
761761
int
762762
""",
763763
)
764-
def func_with_rtype_in_weird_spot(a: int, b: int) -> int: # noqa: ARG001
764+
def func_with_rtype_in_weird_spot(a: int, b: int) -> int:
765765
"""A func
766766
767767
:param a: a tells us something
@@ -809,7 +809,7 @@ def func_with_rtype_in_weird_spot(a: int, b: int) -> int: # noqa: ARG001
809809
More stuff here.
810810
""",
811811
)
812-
def empty_line_between_parameters(a: int, b: int) -> int: # noqa: ARG001
812+
def empty_line_between_parameters(a: int, b: int) -> int:
813813
"""A func
814814
815815
:param a: One of the following possibilities:
@@ -1002,7 +1002,7 @@ def napoleon_returns() -> CodeType:
10021002
10031003
""",
10041004
)
1005-
def google_docstrings(arg1: CodeType, arg2: ModuleType) -> CodeType: # noqa: ARG001
1005+
def google_docstrings(arg1: CodeType, arg2: ModuleType) -> CodeType:
10061006
"""Summary line.
10071007
10081008
Extended description of function.
@@ -1034,7 +1034,7 @@ def google_docstrings(arg1: CodeType, arg2: ModuleType) -> CodeType: # noqa: AR
10341034
10351035
""",
10361036
)
1037-
def docstring_with_multiline_note_after_params(param: int) -> None: # noqa: ARG001
1037+
def docstring_with_multiline_note_after_params(param: int) -> None:
10381038
"""Do something.
10391039
10401040
Args:
@@ -1065,7 +1065,7 @@ def docstring_with_multiline_note_after_params(param: int) -> None: # noqa: ARG
10651065
10661066
""",
10671067
)
1068-
def docstring_with_bullet_list_after_params(param: int) -> None: # noqa: ARG001
1068+
def docstring_with_bullet_list_after_params(param: int) -> None:
10691069
"""Do something.
10701070
10711071
Args:
@@ -1098,7 +1098,7 @@ def docstring_with_bullet_list_after_params(param: int) -> None: # noqa: ARG001
10981098
10991099
""",
11001100
)
1101-
def docstring_with_definition_list_after_params(param: int) -> None: # noqa: ARG001
1101+
def docstring_with_definition_list_after_params(param: int) -> None:
11021102
"""Do something.
11031103
11041104
Args:
@@ -1132,7 +1132,7 @@ def docstring_with_definition_list_after_params(param: int) -> None: # noqa: AR
11321132
11331133
""",
11341134
)
1135-
def docstring_with_enum_list_after_params(param: int) -> None: # noqa: ARG001
1135+
def docstring_with_enum_list_after_params(param: int) -> None:
11361136
"""Do something.
11371137
11381138
Args:
@@ -1167,7 +1167,7 @@ def docstring_with_enum_list_after_params(param: int) -> None: # noqa: ARG001
11671167
-[ Example ]-
11681168
""",
11691169
)
1170-
def docstring_with_definition_list_after_params_no_blank_line(param: int) -> None: # noqa: ARG001
1170+
def docstring_with_definition_list_after_params_no_blank_line(param: int) -> None:
11711171
"""Do something.
11721172
11731173
Args:
@@ -1292,7 +1292,7 @@ def typehints_use_signature(a: AsyncGenerator) -> AsyncGenerator:
12921292
""",
12931293
rst_prolog=prolog,
12941294
)
1295-
def docstring_with_multiline_note_after_params_prolog_replace(param: int) -> None: # noqa: ARG001
1295+
def docstring_with_multiline_note_after_params_prolog_replace(param: int) -> None:
12961296
"""Do something.
12971297
12981298
Args:
@@ -1329,7 +1329,7 @@ def docstring_with_multiline_note_after_params_prolog_replace(param: int) -> Non
13291329
""",
13301330
rst_epilog=epilog,
13311331
)
1332-
def docstring_with_multiline_note_after_params_epilog_replace(param: int) -> None: # noqa: ARG001
1332+
def docstring_with_multiline_note_after_params_epilog_replace(param: int) -> None:
13331333
"""Do something.
13341334
13351335
Args:

tests/test_integration_autodoc_type_aliases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def g(s: AliasedClass) -> AliasedClass:
114114
115115
""",
116116
)
117-
def function(x: ArrayLike, y: Schema) -> str: # noqa: ARG001
117+
def function(x: ArrayLike, y: Schema) -> str:
118118
"""
119119
Function docstring.
120120

tests/test_integration_issue_384.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def dec(val: T) -> T:
5959
6060
""",
6161
)
62-
def function(x: int = 5, y: int = 10, z: int = 15) -> str: # noqa: ARG001
62+
def function(x: int = 5, y: int = 10, z: int = 15) -> str:
6363
"""
6464
Function docstring.
6565

tests/test_sphinx_autodoc_typehints.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,15 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
355355
# Zero-length tuple remains
356356
pytest.param(Tuple[()], ":py:data:`~typing.Tuple`", id="Tuple-p"), # noqa: UP006
357357
# Internal single tuple with simple types is flattened in the output
358-
pytest.param(Tuple[(int,)], r":py:data:`~typing.Tuple`\ \[:py:class:`int`]", id="Tuple-p-int"), # noqa: UP006
358+
pytest.param(Tuple[int,], r":py:data:`~typing.Tuple`\ \[:py:class:`int`]", id="Tuple-p-int"), # noqa: UP006
359359
pytest.param(
360-
Tuple[(int, int)], # noqa: UP006
360+
Tuple[int, int], # noqa: UP006
361361
r":py:data:`~typing.Tuple`\ \[:py:class:`int`, :py:class:`int`]",
362362
id="Tuple-p-int-int", # noqa: RUF100, UP006
363363
),
364364
# Ellipsis in single tuple also gets flattened
365365
pytest.param(
366-
Tuple[(int, ...)], # noqa: UP006
366+
Tuple[int, ...], # noqa: UP006
367367
r":py:data:`~typing.Tuple`\ \[:py:class:`int`, :py:data:`...<Ellipsis>`]",
368368
id="Tuple-p-Ellipsis",
369369
),

0 commit comments

Comments
 (0)