I had this problem using Eclipse and solved it as follows:
in the pylint folder (e.g. C:\Python26\Lib\site-packages\pylint
), hold shift, right-click and choose to open the windows command in that folder. Type:
lint.py --generate-rcfile > standard.rc
This creates the standard.rc
configuration file. Open it in notepad and under [MESSAGES CONTROL]
, uncomment
disable=
and add the message ID's you want to disable, e.g.:
disable=W0511, C0321
Save the file, and in Eclipse->window->preferences->PyDev->pylint, in the arguments box, type:
--rcfile=C:\Python26\Lib\site-packages\pylint\standard.rc
Now it should work ...
You can also add a comment at the top of your code that will be interpreted by pylint:
# pylint: disable=C0321
link to all pylint message codes
Adding e.g. --disable-ids=C0321
in the arguments box does not work.
All available pylint messages are stored in the dictionary _messages
, an attribute of an instance of the pylint.utils.MessagesHandlerMixIn
class. When running pylint with the argument --disable-ids=...
(at least without a config file), this dictionary is initially empty, raising a KeyError exception within pylint (pylint.utils.MessagesHandlerMixIn.check_message_id()
.
In Eclipse, you can see this error-message in the Pylint Console (windows - show view - Console, select Pylint console from the console options besides the console icon.)