`split_before_first_argument` breaks `split_all_top_level_comma_separated_values` but not `split_all_comma_separated_values`
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)
I'm assuming that the last line in the text fits in the required line length (if not, that's really a problem).
I'm doubtful there's something to do here. The idea is to split only if the line doesn't fit... If by splitting before the first argument the line fits, why would you like to split it? A more descriptive name for split_all_top_level_comma_separated_values would have been "split_all_comma_separated_values_unless_all_of_them_fit_together" (but that's too verbose :) ). The motivation for introducing it was to avoid unnecessary line breaks. Between what all_comma does and what all_top_level_comma does one might want more or less breaks, but to me the idea of using a formatter is that you pick settings that you'd like "in general" and disregard things that don't look exactly as you might like (and move forward instead of thinking the best formatting for each case...)