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

flake8 error E231 after a successful black run #1289

Closed
vytas7 opened this issue Mar 3, 2020 · 4 comments
Closed

flake8 error E231 after a successful black run #1289

vytas7 opened this issue Mar 3, 2020 · 4 comments
Labels
R: duplicate This issue or pull request already exists T: bug Something isn't working

Comments

@vytas7
Copy link

vytas7 commented Mar 3, 2020

To Reproduce Steps to reproduce the behavior:

  1. Take this file: example.py
# A set literal with a trailing comma.
{
    "Something": {"hi": {"My", "set", "items",}},
    "Something else": {},
}
  1. Run Black on it:
black example.py 
All done! ✨ 🍰 ✨
1 file left unchanged.
  1. Run flake8 on it:
flake8 example.py 
example.py:3:46: E231 missing whitespace after ','

Expected behavior A clear and concise description of what you expected to happen.
Expecting not to get any flake8 errors barring the different line length setting, and edge cases where black is unable to condense output under 88 chars.

Environment (please complete the following information):

Python 3.8.1
black, version 19.10b1.dev26+g8fef74c
flake8 3.7.9 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.8.1 on Linux

Also getting the same behaviour with black-19.10b0.

@vytas7 vytas7 added the T: bug Something isn't working label Mar 3, 2020
@ambv
Copy link
Collaborator

ambv commented Mar 3, 2020

This is a bug related to #1288 and will be fixed as part of that issue. Thank you for the time to report this!

In the mean time, if you remove the trailing comma by hand, Black won't re-add it.

@ambv ambv closed this as completed Mar 3, 2020
@ambv ambv added the R: duplicate This issue or pull request already exists label Mar 3, 2020
wyli added a commit to Project-MONAI/MONAI that referenced this issue May 5, 2020
eloquence added a commit to freedomofpress/securedrop-workstation that referenced this issue Jun 6, 2020
eloquence added a commit to freedomofpress/securedrop-workstation that referenced this issue Jun 6, 2020
eloquence added a commit to freedomofpress/securedrop-workstation that referenced this issue Jun 11, 2020
@mezhaka
Copy link

mezhaka commented Jan 31, 2022

This is still reproducible despite the #1288 has been closed. Would it be possible to re-open this issue?

@felix-hilden
Copy link
Collaborator

Hi! I tried it on the playground, but it's formatted correctly. Do you have a failing example? (meaning unmodified but would expect modifications)

@mezhaka
Copy link

mezhaka commented Jan 31, 2022

@felix-hilden My bad. I used black 19.10b0 and indeed in the most recent 22.1.0 this problem is resolved.

eaon pushed a commit to freedomofpress/securedrop-updater that referenced this issue Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: duplicate This issue or pull request already exists T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants