yapf
yapf copied to clipboard
Prevent double indenting when splitting function parameters in if or with
Hi, is this supported by yapf configuration if I want to prevent the function parameters from being indented twice in this case:
if func(
a,
b,
):
pass
Output:
if func(
a,
b,
):
pass
Desired output:
if func(
a,
b,
):
pass
I can get the output that I want by changing https://github.com/google/yapf/blob/main/yapf/yapflib/format_decision_state.py#L980 from
return token_indent + style.Get('CONTINUATION_INDENT_WIDTH')
to
return token_indent
But I wonder if this is configurable.
Looks like I have the opposite issue: https://github.com/google/yapf/issues/843 ; maybe you find something helpful in this ticket and its links.
It's only when CONTINUATION_INDENT_WIDTH = 4 ):
DEDENT_CLOSING_BRACKETS = true solved it in function definition but not in function call