Black: Does not comply with E203 from pep8

Created on 7 Jun 2018  路  2Comments  路  Source: psf/black

Operating system:
Python version: 3.6
Black version: 18.6b1
Does also happen on master: yes

Create a file with

tup = nsamples, nalleless[i : i + size], i, size

and black won't correct the white spaces around :.

Most helpful comment

pep8 is wrong here. Quoting black's README: "This behaviour may raise E203 whitespace before ':' warnings in style guide enforcement tools like Flake8. Since E203 is not PEP 8 compliant, you should tell Flake8 to ignore these warnings."

In general when using black it's safe to disable formatting-related errors in tools like flake8; black takes care of the styling minutiae for you.

All 2 comments

pep8 is wrong here. Quoting black's README: "This behaviour may raise E203 whitespace before ':' warnings in style guide enforcement tools like Flake8. Since E203 is not PEP 8 compliant, you should tell Flake8 to ignore these warnings."

In general when using black it's safe to disable formatting-related errors in tools like flake8; black takes care of the styling minutiae for you.

Thanks a lot, @JelleZijlstra !

Was this page helpful?
0 / 5 - 0 ratings