plinss / flake8-noqa

flake8 plugin to validate #noqa comments - Mirror of https://gitlab.linss.com/open-source/flake8/flake8-noqa
GNU Lesser General Public License v3.0
41 stars 6 forks source link

Allow ignoring T000 (TODO marker) #29

Closed PeterJCLaw closed 1 year ago

PeterJCLaw commented 1 year ago

Given the following code:

# TODO: make this better # noqa: T000

When running flake8 with flake8-noqa and flake8-todo both installed the user is stuck having either the T000 warning about the TODO or the NQA102. I'm guessing this is related to the behaviour previously partially discussed in https://github.com/plinss/flake8-noqa/issues/26, though slightly different.

I've tried putting the noqa comment both before and after the TODO comment, neither of those works.

plinss commented 1 year ago

This is an issue in flake8-todo, specifically these lines need to be simply removed. (And the pycodestyle import and dependency in setup.py can be removed too.)

flake8-todo is checking for the existence of a #noqa comment and not reporting the violation if present. This is an anti-pattern. flake8-todo should simply report the violation and let flake8 filter out the #noqa.

Please file an issue on flake8-todo.

PeterJCLaw commented 1 year ago

Aha, thanks!