PyCQA / pycodestyle

Simple Python style checker in one Python file
https://pycodestyle.pycqa.org
Other
5.01k stars 755 forks source link

E502: Fix E502 being disabled after a comment in a logical line #1234

Closed augustelalande closed 5 months ago

augustelalande commented 5 months ago

Since the comment flag was being set and then never disabled in the explicit_line_join implementation, any redundant backslash which occured after the first comment in a logical line would go undetected. e.g.

y = (
    2 + 2  # \
    + 3  # \
    + 4 \
    + 3
)

would not detect the redundant backslash after the 4.

augustelalande commented 5 months ago

Is anything blocking this?