mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-31 07:38:00 +00:00
Group binary operators with same precedence only (#7010)
This commit is contained in:
parent
eb552da8a9
commit
92143afeee
4 changed files with 55 additions and 80 deletions
|
@ -311,38 +311,6 @@ last_call()
|
|||
sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
|
||||
)
|
||||
xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod(
|
||||
@@ -328,13 +331,18 @@
|
||||
):
|
||||
return True
|
||||
if (
|
||||
- ~aaaa.a + aaaa.b - aaaa.c * aaaa.d / aaaa.e
|
||||
+ ~aaaa.a
|
||||
+ + aaaa.b
|
||||
+ - aaaa.c * aaaa.d / aaaa.e
|
||||
| aaaa.f & aaaa.g % aaaa.h ^ aaaa.i << aaaa.k >> aaaa.l**aaaa.m // aaaa.n
|
||||
):
|
||||
return True
|
||||
if (
|
||||
- ~aaaaaaaa.a + aaaaaaaa.b - aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e
|
||||
- | aaaaaaaa.f & aaaaaaaa.g % aaaaaaaa.h
|
||||
+ ~aaaaaaaa.a
|
||||
+ + aaaaaaaa.b
|
||||
+ - aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e
|
||||
+ | aaaaaaaa.f
|
||||
+ & aaaaaaaa.g % aaaaaaaa.h
|
||||
^ aaaaaaaa.i << aaaaaaaa.k >> aaaaaaaa.l**aaaaaaaa.m // aaaaaaaa.n
|
||||
):
|
||||
return True
|
||||
@@ -342,7 +350,8 @@
|
||||
~aaaaaaaaaaaaaaaa.a
|
||||
+ aaaaaaaaaaaaaaaa.b
|
||||
- aaaaaaaaaaaaaaaa.c * aaaaaaaaaaaaaaaa.d @ aaaaaaaaaaaaaaaa.e
|
||||
- | aaaaaaaaaaaaaaaa.f & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h
|
||||
+ | aaaaaaaaaaaaaaaa.f
|
||||
+ & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h
|
||||
^ aaaaaaaaaaaaaaaa.i
|
||||
<< aaaaaaaaaaaaaaaa.k
|
||||
>> aaaaaaaaaaaaaaaa.l**aaaaaaaaaaaaaaaa.m // aaaaaaaaaaaaaaaa.n
|
||||
```
|
||||
|
||||
## Ruff Output
|
||||
|
@ -681,18 +649,13 @@ if (
|
|||
):
|
||||
return True
|
||||
if (
|
||||
~aaaa.a
|
||||
+ aaaa.b
|
||||
- aaaa.c * aaaa.d / aaaa.e
|
||||
~aaaa.a + aaaa.b - aaaa.c * aaaa.d / aaaa.e
|
||||
| aaaa.f & aaaa.g % aaaa.h ^ aaaa.i << aaaa.k >> aaaa.l**aaaa.m // aaaa.n
|
||||
):
|
||||
return True
|
||||
if (
|
||||
~aaaaaaaa.a
|
||||
+ aaaaaaaa.b
|
||||
- aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e
|
||||
| aaaaaaaa.f
|
||||
& aaaaaaaa.g % aaaaaaaa.h
|
||||
~aaaaaaaa.a + aaaaaaaa.b - aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e
|
||||
| aaaaaaaa.f & aaaaaaaa.g % aaaaaaaa.h
|
||||
^ aaaaaaaa.i << aaaaaaaa.k >> aaaaaaaa.l**aaaaaaaa.m // aaaaaaaa.n
|
||||
):
|
||||
return True
|
||||
|
@ -700,8 +663,7 @@ if (
|
|||
~aaaaaaaaaaaaaaaa.a
|
||||
+ aaaaaaaaaaaaaaaa.b
|
||||
- aaaaaaaaaaaaaaaa.c * aaaaaaaaaaaaaaaa.d @ aaaaaaaaaaaaaaaa.e
|
||||
| aaaaaaaaaaaaaaaa.f
|
||||
& aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h
|
||||
| aaaaaaaaaaaaaaaa.f & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h
|
||||
^ aaaaaaaaaaaaaaaa.i
|
||||
<< aaaaaaaaaaaaaaaa.k
|
||||
>> aaaaaaaaaaaaaaaa.l**aaaaaaaaaaaaaaaa.m // aaaaaaaaaaaaaaaa.n
|
||||
|
|
|
@ -215,8 +215,7 @@ self._assert_skipping(
|
|||
(
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
||||
"cccccccccccccccccccccccccc"
|
||||
% aaaaaaaaaaaa
|
||||
"cccccccccccccccccccccccccc" % aaaaaaaaaaaa
|
||||
+ x
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue