Black: flake8 error E231 after a successful black run

Created on 3 Mar 2020  ·  1Comment  ·  Source: psf/black

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.

bug duplicate

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings