google / google/yapf

coalesce_brackets not working together with dedent_closing_brackets

Open
#446 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

Yapf 0.16.3. Test file (what I want/expect):
```
with something:
for more in indentation:
base_html = base_template.render({
'header': self.header,
'pages': included_pages,
'footer': self.footer
}) # <--- I want the closing } and ) together on a separate line

```

With both true:
```
[style]
based_on_style = pep8
column_limit = 99
coalesce_brackets = true
dedent_closing_brackets = true
```
gives:
```
with something:
for more in indentation:
base_html = base_template.render({
'header': self.header,
'pages': included_pages,
'footer': self.footer}) # <--- I want the closing } and ) together on a separate line
```

With:
```
[style]
based_on_style = pep8
column_limit = 99
coalesce_brackets = false
dedent_closing_brackets = true
```
gives:
```
with something:
for more in indentation:
base_html = base_template.render(
{
'header': self.header,
'pages': included_pages,
'footer': self.footer
}
) # <--- I want the closing } and ) together on a separate line
```

With:
```
[style]
based_on_style = pep8
column_limit = 99
coalesce_brackets = true
dedent_closing_brackets = false
```
gives:
```
with something:
for more in indentation:
base_html = base_template.render({
'header': self.header,
'pages': included_pages,
'footer': self.footer}) # <--- I want the closing } and ) together on a separate line
```

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.