-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Trailing comma for function with one arg #880
Labels
Comments
That's a bug,
|
djb7
added a commit
to djb7/black
that referenced
this issue
Jun 9, 2019
Modified maybe_remove_trailing_comma to remove trailing commas for typedarglists (in addition to arglists), and updated line split logic to ensure that all lines in a function definition that contain only one arg have a trailing comma.
I made pull request #891 with a potential fix. Please let me know if the approach makes sense and if you have any suggestions for improvement. |
djb7
added a commit
to djb7/black
that referenced
this issue
Jun 9, 2019
Modified maybe_remove_trailing_comma to remove trailing commas for typedarglists (in addition to arglists), and updated line split logic to ensure that all lines in a function definition that contain only one arg have a trailing comma.
ghost
mentioned this issue
Jun 9, 2019
djb7
added a commit
to djb7/black
that referenced
this issue
Jun 10, 2019
Modified maybe_remove_trailing_comma to remove trailing commas for typedarglists (in addition to arglists), and updated line split logic to ensure that all lines in a function definition that contain only one arg have a trailing comma.
JelleZijlstra
pushed a commit
that referenced
this issue
Jun 15, 2019
Modified maybe_remove_trailing_comma to remove trailing commas for typedarglists (in addition to arglists), and updated line split logic to ensure that all lines in a function definition that contain only one arg have a trailing comma.
Looks like this was fixed in 9394de1. Can this be closed? |
yep. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A function with one argument keeps the trailing comma but if there are two it is stripped.
In:
Out
From https://black.now.sh/?version=stable&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ACGAFNdAD2IimZxl1N_WlbvK5V-4TOOTwYyJEleH-JCdis69M0BXQy1O1PWCxUpRscYAufHo8BjrjIj1dM6YL_cyWPemFXxt1cpBhl0f8lWpI3sZ5u99cYAAACFuqAGuJSBnwABb4cBAAAAtWKNgbHEZ_sCAAAAAARZWg==
The text was updated successfully, but these errors were encountered: