google / google/yapf

Formatting regression

Open
#415 13 comments 9 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

My `style.yapf`:
```
[style]
based_on_style = pep8
DEDENT_CLOSING_BRACKETS = true
```

I had a code like this:
```
def a():
class B:
def c(self):
self.fields['lorem'].label = (
'lorem ipsum dolor sit amet blah blah x'
)
```
and yapf seemed to like it, however after recent upgrade from 0.16.1 to 0.16.2 it started reformatting it to:
```
def a():
class B:
def c(self):
self.fields['lorem'
].label = ('lorem ipsum dolor sit amet blah blah x')
```

It seems like a terrible place for a newline. Any idea why it happens?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.