-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add support for ignoring some warnings #146
Comments
Original comment by bukzor on Launchpad: We have some questionable-but-necessary code which uses globals().update(). The of course causes pyflakes to freak out about undefined variables. I'd like to be able to ignore those warnings, instead of ignoring pyflakes altogether. |
Original comment by esz-michel on Launchpad: @sinzui: Can you link to the changeset? I am curious to see how this was implemented. Sorry if the link is already available somewhere, but I could noit find it :\ I would really like this feature as well, but more fine-grained as proposed. For example, pylint allows you to disable a specific error-code (see http://www.logilab.org/card/pylint_manual#messages-control). Or, the Java @SuppressWarnings annotation also allows you to ignore specific warnings. I find the proposed solution to simply ignore pyflakes altogether is a bit like a "except Exception": You might miss other errors ;) |
Original comment by sinzui on Launchpad: Adi extended PyFlakesChecker to accept the raw text of the module being checked. The report() method looks of the line number of warning/error and in the text and looks for "# pyflakes:ignore". The report returns early if the comment is present. |
Original comment by adiroiban (@adiroiban?) on Launchpad: Hi, Right now, pyflakes messages do not have a ID for each message class. In pylint each message class has its own ID. I agree that this all or nothing filter can lead to other troubles. I will check to see if pyflakes developers would like to accept a patch to pyflakes to add IDs for each message class, and then we can improve the current pocketlint filter. |
Original comment by bukzor on Launchpad: Alternative solution: use a pylintrc that is only roughly as picky as pyflakes. |
Original comment by glyph on Launchpad: There's already a bug for automatically detecting the entirely detectable class of error in the example here, isn't there? It would be so much nicer to do that than to encourage users to drop these comment turds into their code. |
Original comment by exarkun (@exarkun?) on Launchpad: More than one: https://bugs.launchpad.net/pyflakes/+bug/885140 Probably others. Fixing these real problems would be a great win for all pyflakes users. |
Original report by adiroiban (@adiroiban?) on Launchpad:
It would be nice if pyflakes would provide an option for ignoring some warnings.
For example I have this code:
And pyflakes will complain that setproctitle is redefined.
Maybe this is a bad code and this kind of things should be never ignored, but I just want to know if such a feature is wanted in pyflakes.
Here is a workaround for implementing pyflakes:ignore
The text was updated successfully, but these errors were encountered: