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

Add magic-trailing-comma newline to function definition and call. #3093

Closed
synchronizing opened this issue Jun 1, 2022 · 2 comments
Closed
Labels
R: invalid This issue / pull request doesn't seem right

Comments

@synchronizing
Copy link

synchronizing commented Jun 1, 2022

The latest release, 22.3.0, issue #2918, PR #2942, has broken formatting for function definition and call. In previous versions of Black the following:

def intentional_comma(a: int, b: int, c: int,) -> int:
    return a + b + c

def intentional_comma(a: int, b: int, c: int,):
    return a + b + c

intentional_comma(a=10, b=20, c=30,)

Would be formatted to:

def intentional_comma(
    a: int, 
    b: int, 
    c: int,
) -> int:
    return a + b + c

def intentional_comma(
    a: int, 
    b: int, 
    c: int,
):
    return a + b + c

intentional_comma(
    a=10, 
    b=20, 
    c=30,
)

But the new versioning breaks this, and the above is now formatted as:

def intentional_comma(a: int, b: int, c: int,) -> int:
    return a + b + c

def intentional_comma(
    a: int, b: int, c: int,
):
    return a + b + c

intentional_comma(
    a=10, b=20, c=30,
)
@synchronizing synchronizing added the T: bug Something isn't working label Jun 1, 2022
@zsol
Copy link
Collaborator

zsol commented Jun 1, 2022

I can't repro this, how are you invoking Black?

@synchronizing
Copy link
Author

vscode was invoking it. Not sure what happened, but after reinstalling Black things seems to be back to normal. Closing this.

@zsol zsol added R: invalid This issue / pull request doesn't seem right and removed T: bug Something isn't working labels Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: invalid This issue / pull request doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants