-
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
Actually add trailing commas to collection literals even if there are terminating comments #3393
Conversation
d8a621e
to
e9c4f5d
Compare
diff-shades results comparing this PR (aa6f082) to main (dd0e912). The full diff is available in the logs under the "Generate HTML diff report" step.
|
@@ -1,5 +1,11 @@ | |||
def f(a,): | |||
d = {'key': 'value',} | |||
e = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add similar test cases using set, tuple, and list literals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment. Yes, I've just added those.
arg1, | ||
arg2, | ||
arg3, | ||
arg4, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems short enough to fit in one line, so it's a little weird to me that we don't. However, current behavior is already to put everything on its own line and that seems fine, so let's leave it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This is great 🚢
This was annoying to change because I had to first allow transformers to also receive a Mode() argument.
Fixes #3072
Description
Checklist - did you ...
CHANGES.md
if necessary?