Black: Document that W503 generated by pycodestyle is not PEP 8-compliant

Created on 21 Mar 2018  路  3Comments  路  Source: psf/black

Not sure if feature or bug.

 $ black --version
black, version 18.3a3
 $ flake8 --version
3.5.0 (mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.6.0) CPython 3.6.2 on Linux
 $ cat test.py
def meh(eh):
    if ("a" not in eh or ("b" not in eh and "c" not in eh and "d" not in eh) or "e" not in eh):
        return True
 $ black .    
reformatted test.py
 $ cat test.py
def meh(eh):
    if (
        "a" not in eh
        or ("b" not in eh and "c" not in eh and "d" not in eh)
        or "e" not in eh
    ):
        return True
 $ flake8 --select=W
./test.py:4:9: W503 line break before binary operator
./test.py:5:9: W503 line break before binary operator
 $ 
documentation good first issue

Most helpful comment

@ambv Weird, I thought I checked the black .flake8 and the W503 wasn't excluded, only it is.

How about a black option to generate a default black-compatible .flake8 file?

All 3 comments

W503 is incompatible with PEP 8. See https://github.com/ambv/black/pull/36 for details. We need to document this.

In fact, let's reopen this as a documentation issue.

@ambv Weird, I thought I checked the black .flake8 and the W503 wasn't excluded, only it is.

How about a black option to generate a default black-compatible .flake8 file?

Was this page helpful?
0 / 5 - 0 ratings