-
-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise errors when "# noqa" lines don't have any issues #603
Comments
In GitLab by @sigmavirus24 on Aug 1, 2017, 04:45 This makes good sense. I'm not sure when |
In GitLab by @OddBloke on Aug 1, 2017, 07:21 @sigmavirus24 I had a cursory look around the code to work out how to do this, and I couldn't really figure out where it would fit in. Do you have a high-level idea of how this would be implemented that I could have a stab at? |
There's also flake8-noqa, that I find very promising 🙂 |
flake8-noqa reaches into internals and will break in the future so I wouldn't suggest using that. as for the flake8-docstrings issue, pydocstyle has their own (incorrect and incompatible) view of |
Oh OK, thank you for this information @asottile! |
This should probably be an optional feature (either opt-in or opt-out); otherwise some developers are bound to get increasingly annoyed by an error check that they have no choice but to constantly enable/disable for the same line if they edit the file frequently enough ( |
I'd like to see this as well, but will add that I'd like a way to specify that certain codes or groups are outside of Flake8 (from other tools). I've implemented that feature in flake8-noqa, but there's been no acknowledgment from the author since last year: plinss/flake8-noqa#30 |
@Avasam no. Those tools should have instead created their own comment prefix. They could have read from Flake8 if they desired but created their own prefix to avoid this issue and chose not to. |
In GitLab by @OddBloke on Jul 27, 2017, 06:27
Please describe how you installed Flake8
On Ubuntu Artful:
Please provide the exact, unmodified output of
flake8 --bug-report
Please describe the problem or feature
I would like to be able to instruct flake8 to error out when a "# noqa" comment doesn't cause an error to be ignored. This would help us keep our codebase as flake'd as possible, because we'd be forced to remove linting ignores as they are fixed or become irrelevant.
As a specific example, we have code which currently causes an F401 because the imports are only used in Python typing comments. A reductive case:
Once #118 has been addressed, this line should no longer be raising an F401, so I would like to be forced to remove the noqa comment. (This would then mean, after the removal, that we would correctly catch the addition of unused typing imports.)
The text was updated successfully, but these errors were encountered: