I really liked the Pylint integration in Eclipse/Pydev but I have switched to PyCharm since JetBrains released CE edition. Pycharm supports PEP8 auditing “out of the box”, but I found out lately, that it is a little “loose” on style compared to pylint. Running pylint in pycharm didn’t seem to be supported in any ways so I became curious about how I could add this functionality to my favourite IDE.
After some searching, I realised that there is not much out there about this topic. I could not accept it and went after the challenge…
Running Pylint in PyCharm
As it turned out, it is much simpler than I initially thought. First install pylint, it’s very easy, there are various ways of doing it depending on operating system, your preference, etc. so the installation is out of the scope of this guide.
Create an external tool:
My pylint config is fairly simple, nearly stock standard so I simply added my customisation to the “parameters” line, but for more complex setups, I strongly recommend setting
.pylintrc in your HOME then adding your config file to the parameter line as an argument. This basically pipes your code through pylint and displays the results in the “run”
Configure output filter:
These will create an XML config that looks like this on OSX:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
As the description says, this will essentially give you quick jump links to the parts of your code where the non-compliant code is.
Clicking on any of the blue lines will simply navigate you to the line where the issue is, and adding keymap to this tool can improve your workflow too.