This patch enables to make pychecker quiet on source code line basis by adding a "#$pycheck_no" comment (=quiet on all errors concerning this line) or a "#$pycheck_no=re-pattern" comment (quiets the message if the re-pattern is found inside the message).
Example: "def __init__(self): #$pycheck_no='Base class .* not called'"
A re-pattern can of course use OR (|) syntax to stop more warnings specifically.
The patch also solves problems with pychecker when not called from the current working directory.
Without that #$pycheck_no possibilty I'm not able to achieve a zero-waring status for big existing code.
Also there are often situations where it is not worth the effort or not really possible to tell ignoring patterns specifically and complicatedly through a .pycheckrc. Thus telling a NO! on source line basis upon actual warnings is the best/practical practice in my opinion.
Thus I'd like to see this feature in future regular pychecker distribution.
I'm running this thing since about 6 months successfully with a lot of projects.
I'll also post my pychecker plug-in module for PythonWin which enables to use pychecker easily in PythonWin (usage similar to the exising Grep-Tool (Ctrl-N,P) - but can run in background due to the time consuming pychecker task):
One can jump to Warning source lines by DoubleClick and auto-add #$pycheck_no / #$pycheck_no=specific-re-pattern tags to source lines by simply context/right-mouse-clicking on warning lines.
I'd also like to use the same class names as .pycheckrc for stopping specific errors. Yet I found, that these Warning class ID strings are not stored currently in the Warning objects and are thus not trackable easily so far. Maybe this basic possibility should be added in future to have a Warning class tag avaible for better post-processing of Warnings.
Log in to post a comment.