wemake-services / flake8-eradicate

Flake8 plugin to find commented out or dead code
https://pypi.org/project/flake8-eradicate/
MIT License
308 stars 12 forks source link

Issue with flake8-noqa, flake8-eradicate and commented out code #255

Open shestakovks opened 2 years ago

shestakovks commented 2 years ago

Hello. I'm using flake8, flake8-noqa & flake8-eradicate. Until flake8-noqa==1.2.5 it worked fine, but now I encounter weird behaviour.

Python version

$ python --version
Python 3.9.10

Dependencies: flake8==5.0.4 flake8-eradicate==1.4.0 flake8-noqa==1.2.9

Current behaviour

code.py

# a = 5
a = 7

flake8 run

$ flake8 code.py
code.py:1:1: E800 Found commented out code

code.py

# a = 5  # noqa: E800
a = 7

flake8 run

$ flake8 code.py
code.py:1:1: NQA102 "# noqa: E800" has no matching violations

Expected behaviour

code.py

# a = 5
a = 7

flake8 run

$ flake8 code.py
code.py:1:1: E800 Found commented out code

code.py

# a = 5  # noqa: E800
a = 7

flake8 run -- no error

$ flake8 code.py

I created the same issue in flake8-noqa repository but its author pointed out that the issue could be in your package. Can you please take a look?

njiles commented 2 months ago

Hi - i just ran into this issue today, any updates? Thanks!