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

Single argument to nested function call placed on separate line #828

Closed
dirn opened this issue May 5, 2019 · 1 comment
Closed

Single argument to nested function call placed on separate line #828

dirn opened this issue May 5, 2019 · 1 comment
Labels
R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?

Comments

@dirn
Copy link

dirn commented May 5, 2019

Operating system: macOS
Python version: 3.7.2
Black version: 18.9b0
Does also happen on master: Yes

It looks like Black is exploding arguments to a function within another function call, regardless of whether or not the former's arguments fight onto a single line.

Original code:

text = textwrap.dedent("""
    This
    is
    some
    text.
    """.strip("\n")
)

Expected output:

text = textwrap.dedent(
    """
    This
    is
    some
    text.
    """.strip("\n")
)

Actual output:

text = textwrap.dedent(
    """
    This
    is
    some
    text.
    """.strip(
        "\n"
    )
)

P.S. In this particular case I switched to lstrip and placed it after the call to dedent, but that probably won't always be an option.

@JelleZijlstra JelleZijlstra added the T: style What do we want Blackened code to look like? label May 5, 2019
@zsol zsol added style and removed style labels Jul 22, 2019
@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Sep 27, 2020
@ichard26
Copy link
Collaborator

Duplicate of #256.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

4 participants