Skip to content

Formatter undocumented deviation: Redundant parentheses in boolean expression can lead to extra line breaks #8183

@henribru

Description

@henribru

Black:

def foo():
    while (
        not (aaaaaaaaaaaaaaaaaaaaa(bbbbbbbb, ccccccc)) and dddddddddd < eeeeeeeeeeeeeee
    ):
        pass

Ruff:

def foo():
    while not (
        aaaaaaaaaaaaaaaaaaaaa(bbbbbbbb, ccccccc)
    ) and dddddddddd < eeeeeeeeeeeeeee:
        pass

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingformatterRelated to the formatter

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions