Hang closing brackets
Hey everyone,
Thanks for developing this tool! I'm trying to use in a project where the code style is to hang closing parenthesis. That's the E133 rule from pep8, that can be enabled with the --hang-closing option . For instance, we prefer:
y = {
'a': 1,
'b': 2,
'c': 3,
'd': 4,
}
over
y = {
'a': 1,
'b': 2,
'c': 3,
'd': 4,
}
I'm trying to set up yapf to enforce this, but it seems to always dedent the closing brackets... I thought setting align_closing_bracket_with_visual_indent to true was precisely made for this, but it doesn't seem to change anything...
Am I doing something wrong? Can I make yapf enforce hanging closing brackets? Thanks in advance!
My .style.yapf:
[style]
based_on_style = pep8
align_closing_bracket_with_visual_indent = true
I'm having a similar problem. I've tried align_closing_bracket_with_visual_indent=true and dedent_closing_brackets=false separately and in combination. Despite the implication of those setting names, neither seems to produce hanging braces. yapf 0.28.0
It looks like, for formatting, the rule to effectively control this specific behavior is
indent_closing_brackets = true