Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCLN remove unnecessary trailing commas to get ready for new version of black #35925
Comments
I think the easiest way to find them is actually to let black (using the latest version) reformat the file(s), and then check in the diff for which ones the trailing comma can be removed (and then run black again) |
I am looking at these right now
edit: #35956 @MarcoGorelli if it looks good I can open another with some more later today. |
@jpribyl thanks! Yes, feel free to do so, any help here would be appreciated! |
with several more files:
|
working on these right now:
|
I'm searching using this regex: Edit: |
I would just upgrade |
@MarcoGorelli when I am running black again, it changes file back with trailing commas |
That's fine. Two things may happen when running the new version of
It's the second case in which we want to remove the trailing commas, so that both the current and the new version of From a quick glance it looks like you've done it correctly anyway, will review later today |
Working on these files:
|
Now Working on
|
Working on:
|
Working on these files
|
hello, I'm new to this community.. Now I'm working on these files :
|
Working on:
|
Working On: |
The new version of
black
is consistent in how it handles the magic trailing commas. So if we upgradeblack
and apply it, lots of files will be changed. However, the diff needn't be so large if we remove unnecessary trailing commas before upgrading.E.g. in pandas/core/aggregation.py there is
which has an unnecessary trailing comma.
The new version of
black
would transform this asHowever, if we instead remove the trailing comma and write it as
then both the current and the new versions of black will be OK with it.
So, PRs to remove some unnecessary trailing commas would be welcome - perhaps keep each PR limited to 5-10 files changed.
Files that (may) need changing are: