Arrays broken before function call elements
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
When breaking an array, yapf appears to treat array elements that are function calls differently from those that are not:
$ cat issue.py
array = [first, make_second(), third, fourth, fifth, make_sixth(), seventh, eighth]
$ yapf issue.py
array = [
first,
make_second(), third, fourth, fifth,
make_sixth(), seventh, eighth
]
This seems very strange to me. I'm not sure whether it's intended behavior or a bug, because I couldn't find a test for it or configuration option to disable it (I'd like to).
I would have expected either:
array = [
first, make_second(), third, fourth, fifth, make_sixth(), seventh, eighth
]
or:
array = [
first,
make_second(),
third,
fourth,
fifth,
make_sixth(),
seventh,
eighth
]
(ideally option A, I think; you can get option B already by adding a trailing slash)
Contributor guide
Assessment
This issue has not been assessed yet.