-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Odd Formatting Bug #1523
Comments
If you add a trailing comma at the end of the |
Maybe I explained myself incorrectly. In your screenshots you are removing the trailing comma and adding one trailing comma at the end, while what I suggested was doing: posts = [
{
"author": "CoreyMS",
"title": "Blog Post 1",
"content": "First post content",
"date_posted": datetime.datetime.utcnow().strftime("%A, %x"),
},
{
"author": "CoreyMS",
"title": "Blog Post 1",
"content": "First post content",
"date_posted": datetime.datetime.utcnow() + datetime.timedelta(3).strftime("%A, %x"),
}
] which should keep the format. |
Nothing changes, even if I copy the same exact code that you sent 😞 |
To Reproduce Steps to reproduce the behavior:
Write this:
Press
ctrl + s
to save on vscode with black as the formatter (It does not matter if you do this or run black normally withblack .
This happens:
Expected behavior:
It keeps that style instead of the (no-offence) ugly formatting
Environment:
Does this bug also happen on master?
It does
Additional context:
Also with this, black is colliding with flake8. Black makes a code that looks like this:
To this:
(It adds the extra
,
at the end without a space)This raises
missing whitespace after ','flake8(E231)
Is there a configuration option to either add a space or just not have a trailing comma at the end? I tried to look up in the docs for such configuration option but failed to find it 😞
Additionally, I cannot see any configuration options in the docs that I can add in the configuration file
The text was updated successfully, but these errors were encountered: