Is there a way to make black <file.py>
or ruff format <file.py>
format lists which have more elements than can fit in one line into a few lines with multiple list elements per line. Specifically, can I configure my pyproject.toml
file to make this happen?
For example, a list like this which is longer than my maximum line-length
of 100 characters…
my_long_list = ["Hello", "world", "how", "are", "you", "doing", "today", "!", "What", "is", "up", "?"]
should be formatted something like this
my_long_list = [
"Hello", "world", "how", "are", "you", "doing", "today", "!",
"What", "is", "up", "?"
]
and not like this (current default behavior)
my_long_list = [
"Hello",
"world",
"how",
"are",
"you",
"doing",
"today",
"!",
"What",
"is",
"up",
"?",
]