yapf
yapf copied to clipboard
Nested brackets split across multiple lines formats incorrectly with `continuation_align_style = fixed`
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)
foo = Foo(
[
(0, 1),
(0, 1),
(0, 1),
(0, 1),
],
[],
)
Sample code (post-formatting)
foo = Foo(
[
(0, 1),
(0, 1),
(0, 1),
(0, 1),
],
[],
)
Config file
[style]
continuation_align_style = fixed
Maybe you can set up: continuation_align_style=valign-right
It indeed works on my side.
@Jieli12 Thank you, that seems to work. Is the behaviour with fixed to be expected that? I wasn't quite clear from the docs what it's meant to do.