Skip to content

Commit 5711b3a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1b27664 commit 5711b3a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

mypy/plugins/attrs.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ def attr_class_maker_callback(
318318
frozen = _get_frozen(ctx, frozen_default)
319319
order = _determine_eq_order(ctx)
320320
slots = _get_decorator_bool_argument(ctx, "slots", slots_default)
321-
hashable = _get_decorator_bool_argument(ctx, "hash", False) or _get_decorator_bool_argument(ctx, "unsafe_hash", False)
321+
hashable = _get_decorator_bool_argument(ctx, "hash", False) or _get_decorator_bool_argument(
322+
ctx, "unsafe_hash", False
323+
)
322324

323325
auto_attribs = _get_decorator_optional_bool_argument(ctx, "auto_attribs", auto_attribs_default)
324326
kw_only = _get_decorator_bool_argument(ctx, "kw_only", False)
@@ -931,9 +933,13 @@ def _add_match_args(ctx: mypy.plugin.ClassDefContext, attributes: list[Attribute
931933
)
932934
add_attribute_to_class(api=ctx.api, cls=ctx.cls, name="__match_args__", typ=match_args)
933935

936+
934937
def _remove_hashability(ctx: mypy.plugin.ClassDefContext) -> None:
935938
"""Remove hashability from a class."""
936-
add_attribute_to_class(ctx.api, ctx.cls, "__hash__", NoneType(), is_classvar=True, overwrite_existing=True)
939+
add_attribute_to_class(
940+
ctx.api, ctx.cls, "__hash__", NoneType(), is_classvar=True, overwrite_existing=True
941+
)
942+
937943

938944
class MethodAdder:
939945
"""Helper to add methods to a TypeInfo.

test-data/unit/check-plugin-attrs.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2352,4 +2352,4 @@ class A:
23522352
a: Hashable = A(1)
23532353

23542354
[builtins fixtures/plugin_attrs.pyi]
2355-
[typing fixtures/typing-full.pyi]
2355+
[typing fixtures/typing-full.pyi]

0 commit comments

Comments
 (0)