mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-09 03:50:58 +00:00
Fix formatting of chained boolean operations (#6394)
Closes https://github.com/astral-sh/ruff/issues/6068 These commits are kind of a mess as I did some stumbling around here. Unrolls formatting of chained boolean operations to prevent nested grouping which gives us Black-compatible formatting where each boolean operation is on a new line.
This commit is contained in:
parent
63ffadf0b8
commit
999d88e773
5 changed files with 177 additions and 16 deletions
|
@ -62,3 +62,35 @@ if (
|
|||
and [dddddddddddddd, eeeeeeeeee, fffffffffffffff]
|
||||
):
|
||||
pass
|
||||
|
||||
# Regression test for https://github.com/astral-sh/ruff/issues/6068
|
||||
if not (
|
||||
isinstance(aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb) or numpy and isinstance(ccccccccccc, dddddd)
|
||||
):
|
||||
pass
|
||||
|
||||
if not (
|
||||
isinstance(aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb) and numpy or isinstance(ccccccccccc, dddddd)
|
||||
):
|
||||
pass
|
||||
|
||||
if not (
|
||||
isinstance(aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb) or xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy and isinstance(ccccccccccc, dddddd)
|
||||
):
|
||||
pass
|
||||
|
||||
if not (
|
||||
isinstance(aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb) and xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy or isinstance(ccccccccccc, dddddd)
|
||||
):
|
||||
pass
|
||||
|
||||
|
||||
if not (
|
||||
isinstance(aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb) or (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy) and isinstance(ccccccccccc, dddddd)
|
||||
):
|
||||
pass
|
||||
|
||||
if not (
|
||||
isinstance(aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb) and (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy) or isinstance(ccccccccccc, dddddd)
|
||||
):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue