Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get pylint warnings to be marked in the Pydev Eclipse editor margin?

I have pylint installed (works fine on the command line) and set up within Pydev in Eclipse.

Pylint is being triggered OK when I edit files, and is outputting to the Eclipse console.

But, the pylint warnings don't appear as marks in the editor margin (in the same way as compiler warnings and errors)

Newly-generated warnings don't appear in the Problems view either - there are some old ones showing, but they disappear if I re-save the relevant module.

I know this is possible as I've had it working previously - but how do I set this up?

Ticking or unticking "Redirect Pylint output to console?" doesn't seem to make any difference.

like image 636
DNA Avatar asked Jul 29 '11 13:07

DNA


2 Answers

I had this exact problem today, on a brand new system. I tracked down the cause, and it seems that PyDev refuses to pick up the messages from pylint 0.24.0, which was released on July 20, 2011.

Reverting to the previous version (pylint 0.23.0) seems to have solved the problem. For me, that involved removing everything from Python's Lib/site-packages directory that was related to pylint, and then running python setup.py install from the directory I'd extracted pylint 0.23.0 into. (Without deleting those files in the site-packages directory first, it kept using the new version.) But after both those steps, the messages started showing up in PyDev as expected.

You can check your pylint version with pylint --version from a shell prompt; if it shows 0.23.0 you're good to go.

like image 119
JohnSpeeks Avatar answered Sep 23 '22 07:09

JohnSpeeks


I was having the same problem, and it turned out to be my pylint configuration file (~/.pylintrc by default). Be sure the output-format field is correct. It is under the [REPORTS] section, and the line should be:

output-format=text

If you've ever used pylint with another application (I do with emacs), it might say output-format=parseable.

like image 34
falcojr Avatar answered Sep 20 '22 07:09

falcojr