Properly group assignment targets (#5728)

This commit is contained in:
Micha Reiser 2023-07-13 16:00:49 +02:00 committed by GitHub
parent f48ab2d621
commit 5dd5ee0c5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 113 additions and 15 deletions

View file

@ -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
```