Skip to content

Commit 6067f38

Browse files
pre-commit-ci[bot]Tinche
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 9b33a6c commit 6067f38

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
@@ -323,7 +323,9 @@ def attr_class_maker_callback(
323323
frozen = _get_frozen(ctx, frozen_default)
324324
order = _determine_eq_order(ctx)
325325
slots = _get_decorator_bool_argument(ctx, "slots", slots_default)
326-
hashable = _get_decorator_bool_argument(ctx, "hash", False) or _get_decorator_bool_argument(ctx, "unsafe_hash", False)
326+
hashable = _get_decorator_bool_argument(ctx, "hash", False) or _get_decorator_bool_argument(
327+
ctx, "unsafe_hash", False
328+
)
327329

328330
auto_attribs = _get_decorator_optional_bool_argument(ctx, "auto_attribs", auto_attribs_default)
329331
kw_only = _get_decorator_bool_argument(ctx, "kw_only", False)
@@ -948,9 +950,13 @@ def _add_match_args(ctx: mypy.plugin.ClassDefContext, attributes: list[Attribute
948950
)
949951
add_attribute_to_class(api=ctx.api, cls=ctx.cls, name="__match_args__", typ=match_args)
950952

953+
951954
def _remove_hashability(ctx: mypy.plugin.ClassDefContext) -> None:
952955
"""Remove hashability from a class."""
953-
add_attribute_to_class(ctx.api, ctx.cls, "__hash__", NoneType(), is_classvar=True, overwrite_existing=True)
956+
add_attribute_to_class(
957+
ctx.api, ctx.cls, "__hash__", NoneType(), is_classvar=True, overwrite_existing=True
958+
)
959+
954960

955961
class MethodAdder:
956962
"""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
@@ -2377,4 +2377,4 @@ class A:
23772377
a: Hashable = A(1)
23782378

23792379
[builtins fixtures/plugin_attrs.pyi]
2380-
[typing fixtures/typing-full.pyi]
2380+
[typing fixtures/typing-full.pyi]

0 commit comments

Comments
 (0)