PyCQA / pycodestyle

Simple Python style checker in one Python file

Home Page:https://pycodestyle.pycqa.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

E275: Warning if keyword is at the end of a line

jnsebgosselin opened this issue · comments

I am using pycodestyle 2.9.1 in Spyder and the following code yield a E275 warning on lines 3, 7, and 9. I am not sure if this is as expected.

try:
    xabs = [
        abs(x) for x in
        [1, -2, 3, -4]
        ]
except Exception:
    return
else:
    pass

image

I can't reproduce -- can you attach the exact file?

Sure, there you go:

warn_275_pycodestyle.txt

There is no such warnings when using pycodestyle 2.8.0, which is as expected I guess.

I can't reproduce -- it's probably something spyder is doing incorrectly:

$ pycodestyle --version
2.9.1
$ pycodestyle warn_275_pycodestyle.py 
$

You are correct. I cannot reproduce when evaluating the file with :

import pycodestyle
sut = pycodestyle.StyleGuide()
results = sut.input_file(filename="warn_275_pycodestyle.py")
print(results)

I will report this issue in the Spyder repo directly. Thanks for the quick reply!