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

No line-wrapping for keyword argument #933

Closed
ghost opened this issue Jul 22, 2019 · 1 comment · Fixed by #1132
Closed

No line-wrapping for keyword argument #933

ghost opened this issue Jul 22, 2019 · 1 comment · Fixed by #1132
Labels
F: parentheses Too many parentheses, not enough parentheses, and so on. T: enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Jul 22, 2019

Operating system: Win10 Version 10.0.18362 Build 18362
Python version: 3.7.3
Black version: 9.3b0
Does also happen on master: Yes

Input:

def g() -> None:
    name_of_local_variable = "Very long string value that should be placed on the next line"
    f(
        name_of_the_parameter="Very long string value that should be placed on the next line"
    )

Output:

def g() -> None:
    name_of_local_variable = (
        "Very long string value that should be placed on the next line"
    )
    f(
        name_of_the_parameter="Very long string value that should be placed on the next line"
    )

name_of_local_variable's value is put on the next line, but name_of_the_parameter is untouched.
This is true even if I use name_of_the_parameter=lambda x: "Very long string value that should be placed on the next line" which gives two opportunities for wrapping.

@zsol
Copy link
Collaborator

zsol commented Jul 30, 2019

This is likely the same problem as #620. Will keep this open just in case we decide to do different formatting for kwargs/dict literals

@zsol zsol added T: bug Something isn't working F: parentheses Too many parentheses, not enough parentheses, and so on. T: enhancement New feature or request and removed T: bug Something isn't working labels Jul 30, 2019
@ambv ambv closed this as completed in #1132 May 8, 2020
ambv pushed a commit that referenced this issue May 8, 2020
This pull request's main intention is to wraps long strings (as requested by #182); however, it also provides better string handling in general and, in doing so, closes the following issues:

Closes #26
Closes #182
Closes #933
Closes #1183
Closes #1243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: parentheses Too many parentheses, not enough parentheses, and so on. T: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant