mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-31 07:37:38 +00:00
Properly group assignment targets (#5728)
This commit is contained in:
parent
f48ab2d621
commit
5dd5ee0c5b
4 changed files with 113 additions and 15 deletions
|
@ -14,18 +14,43 @@ a2 = (
|
|||
|
||||
# Break the last element
|
||||
a = asdf = fjhalsdljfalflaflapamsakjsdhflakjdslfjhalsdljfalflaflapamsakjsdhflakjdslfjhalsdljfal = 1
|
||||
|
||||
aa = [
|
||||
bakjdshflkjahdslkfjlasfdahjlfds
|
||||
] = dddd = ddd = fkjaödkjaföjfahlfdalfhaöfaöfhaöfha = g = [3]
|
||||
|
||||
aaaa = ( # trailing
|
||||
# comment
|
||||
bbbbb) = cccccccccccccccc = 3
|
||||
```
|
||||
|
||||
## Output
|
||||
```py
|
||||
# break left hand side
|
||||
a1akjdshflkjahdslkfjlasfdahjlfds = bakjdshflkjahdslkfjlasfdahjlfds = cakjdshflkjahdslkfjlasfdahjlfds = kjaödkjaföjfahlfdalfhaöfaöfhaöfha = fkjaödkjaföjfahlfdalfhaöfaöfhaöfha = g = 3
|
||||
a1akjdshflkjahdslkfjlasfdahjlfds = (
|
||||
bakjdshflkjahdslkfjlasfdahjlfds
|
||||
) = (
|
||||
cakjdshflkjahdslkfjlasfdahjlfds
|
||||
) = kjaödkjaföjfahlfdalfhaöfaöfhaöfha = fkjaödkjaföjfahlfdalfhaöfaöfhaöfha = g = 3
|
||||
|
||||
# join left hand side
|
||||
a2 = (b2) = 2
|
||||
a2 = b2 = 2
|
||||
|
||||
# Break the last element
|
||||
a = asdf = fjhalsdljfalflaflapamsakjsdhflakjdslfjhalsdljfalflaflapamsakjsdhflakjdslfjhalsdljfal = 1
|
||||
a = (
|
||||
asdf
|
||||
) = (
|
||||
fjhalsdljfalflaflapamsakjsdhflakjdslfjhalsdljfalflaflapamsakjsdhflakjdslfjhalsdljfal
|
||||
) = 1
|
||||
|
||||
aa = [
|
||||
bakjdshflkjahdslkfjlasfdahjlfds
|
||||
] = dddd = ddd = fkjaödkjaföjfahlfdalfhaöfaöfhaöfha = g = [3]
|
||||
|
||||
aaaa = ( # trailing
|
||||
# comment
|
||||
bbbbb
|
||||
) = cccccccccccccccc = 3
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue