Skip to content

Commit

Permalink
pre-commit autoupdate
Browse files Browse the repository at this point in the history
Latest black required to remove a bunch of commas to prevent line explosion.
  • Loading branch information
hynek committed Sep 1, 2020
1 parent be6b342 commit f680c5b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 20.8b1
hooks:
- id: black
language_version: python3.8
Expand All @@ -15,7 +15,7 @@ repos:
- id: seed-isort-config

- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
rev: v5.4.2
hooks:
- id: isort
additional_dependencies: [toml]
Expand All @@ -34,7 +34,7 @@ repos:
language_version: python3.8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Expand Up @@ -32,7 +32,6 @@ include_trailing_comma=true
lines_after_imports=2
lines_between_types=1
multi_line_output=3
not_skip="__init__.py"
use_parentheses=true

known_first_party="attr"
Expand Down
3 changes: 2 additions & 1 deletion src/attr/_compat.py
Expand Up @@ -19,9 +19,10 @@


if PY2:
from UserDict import IterableUserDict
from collections import Mapping, Sequence

from UserDict import IterableUserDict

# We 'bundle' isclass instead of using inspect as importing inspect is
# fairly expensive (order of 10-15 ms for a modern machine in 2016)
def isclass(klass):
Expand Down
12 changes: 6 additions & 6 deletions src/attr/_make.py
Expand Up @@ -575,7 +575,7 @@ def __init__(
has_custom_setattr,
):
attrs, base_attrs, base_map = _transform_attrs(
cls, these, auto_attribs, kw_only, collect_by_mro,
cls, these, auto_attribs, kw_only, collect_by_mro
)

self._cls = cls
Expand Down Expand Up @@ -1857,7 +1857,7 @@ def _setattr(attr_name, value_var, has_on_setattr):
"""
Use the cached object.setattr to set *attr_name* to *value_var*.
"""
return "_setattr('%s', %s)" % (attr_name, value_var,)
return "_setattr('%s', %s)" % (attr_name, value_var)


def _setattr_with_converter(attr_name, value_var, has_on_setattr):
Expand All @@ -1880,7 +1880,7 @@ def _assign(attr_name, value, has_on_setattr):
if has_on_setattr:
return _setattr(attr_name, value, True)

return "self.%s = %s" % (attr_name, value,)
return "self.%s = %s" % (attr_name, value)


def _assign_with_converter(attr_name, value_var, has_on_setattr):
Expand Down Expand Up @@ -1941,7 +1941,7 @@ def fmt_setter(attr_name, value_var, has_on_setattr):
if _is_slot_attr(attr_name, base_attr_map):
return _setattr(attr_name, value_var, has_on_setattr)

return "_inst_dict['%s'] = %s" % (attr_name, value_var,)
return "_inst_dict['%s'] = %s" % (attr_name, value_var)

def fmt_setter_with_converter(
attr_name, value_var, has_on_setattr
Expand Down Expand Up @@ -2029,7 +2029,7 @@ def fmt_setter_with_converter(
)
)
elif a.default is not NOTHING and not has_factory:
arg = "%s=attr_dict['%s'].default" % (arg_name, attr_name,)
arg = "%s=attr_dict['%s'].default" % (arg_name, attr_name)
if a.kw_only:
kw_only_args.append(arg)
else:
Expand All @@ -2038,7 +2038,7 @@ def fmt_setter_with_converter(
if a.converter is not None:
lines.append(
fmt_setter_with_converter(
attr_name, arg_name, has_on_setattr,
attr_name, arg_name, has_on_setattr
)
)
names_for_globals[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dunders.py
Expand Up @@ -528,7 +528,7 @@ def test_copy_hash_cleared(self, cache_hash, frozen, slots):
Test that the default hash is recalculated after a copy operation.
"""

kwargs = dict(frozen=frozen, slots=slots, cache_hash=cache_hash,)
kwargs = dict(frozen=frozen, slots=slots, cache_hash=cache_hash)

# Give it an explicit hash if we don't have an implicit one
if not frozen:
Expand Down

0 comments on commit f680c5b

Please sign in to comment.