-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Why set splitted as all elements on new line? #650
Comments
ProblemBase code KEYS1 = {"aaaaa", "aaaaa", "aaaaa", "aaaaa", "aaaaa"} Alice make changes KEYS1 = {"aaaaa", "aaaaa", "aaaaa", "aaaaa", "bbbbb"} Alice format code with black: KEYS1 = {"aaaaa", "aaaaa", "aaaaa", "aaaaa", "bbbbb"} Bob make changes KEYS1 = {"aaaaa", "aaaaa", "aaaaa", "aaaaa", "aaaaa", "ccccc"} Bob format code with black: KEYS1 = {
"aaaaa",
"aaaaa",
"aaaaa",
"aaaaa",
"aaaaa",
"ccccc",
} We have ugly merge conflict of two changes |
Seems related to #601 ? |
In your example, the list was made longer, so you could extend that to making the list arbitrarily long. In that case, the solutions would seem to be one of
|
Sometimes I have similar structures, such as a list of a couple dozen words, or a hundred integers, and black forces them each to their own line, which is ghastly, as is the case in the third line:
becomes:
Is this what it is supposed to do? Is there something I can do to prevent this? |
@reagle I'd do one of the following:
|
@nicktimko, thanks. I had searched the documentation for "disable" and "suspend" but hadn't come across |
As explained in the comments above, this is the intended behavior, and you can opt code out using |
Black v18.9b0
Playground link
Options
--line-length=60
--pyi
Input
Output
Expected
Something like this
The text was updated successfully, but these errors were encountered: