google / google/yapf

`split_before_first_argument` breaks `split_all_top_level_comma_separated_values` but not `split_all_comma_separated_values`

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

Description

Consider the file `test.py`:

def foo():
long_function(long_argument_name_1, long_argument_name_2, long_argument_name_3)

By themselves, the following styles do the same thing, as expected:

$ yapf --style '{split_all_comma_separated_values: True}' test.py

def foo():
long_function(long_argument_name_1,
long_argument_name_2,
long_argument_name_3)

$ yapf --style '{split_all_top_level_comma_separated_values: True}' test.py

def foo():
long_function(long_argument_name_1,
long_argument_name_2,
long_argument_name_3)

But adding the style `split_before_first_argument: True` breaks the `top_level` version only. I would expect the first output in both cases:

$ yapf --style '{split_all_comma_separated_values: True, split_before_first_argument: True}' test.py

def foo():
long_function(
long_argument_name_1,
long_argument_name_2,
long_argument_name_3)

$ yapf --style '{split_all_top_level_comma_separated_values: True, split_before_first_argument: True}' test.py

def foo():
long_function(
long_argument_name_1, long_argument_name_2, long_argument_name_3)

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.