Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a each_dict_entry_on_separate_line for lists? #1209

Closed
marcodicro-dp opened this issue Mar 12, 2024 · 2 comments
Closed

Is there a each_dict_entry_on_separate_line for lists? #1209

marcodicro-dp opened this issue Mar 12, 2024 · 2 comments

Comments

@marcodicro-dp
Copy link

Is there a way to make each_dict_entry_on_separate_line = true to work for lists? Or any other config for this?

E.g.
image

I'd like to keep my original format of one line per list element (As it would happen if they were dicts, like in the first diff).

Current Style:

[style]
based_on_style = google
indent_width = 2
column_limit = 100
continuation_indent_width = 4
each_dict_entry_on_separate_line = true
allow_split_before_dict_value = false
split_before_logical_operator = true
spaces_before_comment = 1
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = false
@kaddkaka
Copy link

kaddkaka commented Mar 13, 2024

Does adding a trailing comma in the list case give the formatting you want?

see this knob:

# Disable the heuristic which places each list element on a separate line
# if the list is comma-terminated.
disable_ending_comma_heuristic = false

@marcodicro-dp
Copy link
Author

Yes! Thank you so much. Didn't know about that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants