Skip to content

Formatter: Break quality check before breaking parentheses #6065

@konstin

Description

@konstin

We need to change the breaking priorities with equality checks and parentheses:

black:

def f():
    return (
        unicodedata.normalize("NFKC", s1).casefold()
        == unicodedata.normalize("NFKC", s2).casefold()
    )

ct_match = (
    aaaaaaaaaaact_id == self.get_content_type(obj=rel_obj, using=instance._state.db).id
)

ours:

def f():
    return unicodedata.normalize("NFKC", s1).casefold() == unicodedata.normalize(
        "NFKC", s2
    ).casefold()

ct_match = aaaaaaaaaaact_id == self.get_content_type(
    obj=rel_obj, using=instance._state.db
).id

Metadata

Metadata

Assignees

Labels

formatterRelated to the formatter

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions