google / google/yapf

Nested brackets split across multiple lines formats incorrectly with `continuation_align_style = fixed`

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

Description

An example best illustrates the issue. Clearly, the sample code (pre-formatting) should be left unchanged by yapf, but its indentation is instead messed up.

Sample code (pre-formatting)
```python
foo = Foo(
[
(0, 1),
(0, 1),
(0, 1),
(0, 1),
],
[],
)
```

Sample code (post-formatting)
```python
foo = Foo(
[
(0, 1),
(0, 1),
(0, 1),
(0, 1),
],
[],
)
```

Config file
```
[style]
continuation_align_style = fixed
```

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.