Running PyLint in PyCharm

At work we use PyCharm for all our Python development. It's a good IDE with great code completion, and decent support for most Python libraries, good unit testing support and good Google App Engine integration. We also use PyLint for checking our code and trying to keep our coding standards up.

One of the things that is nice about running unit tests in PyCharm is that when a test fails, you can click on the file name in the output window and it'll take you to the line in that file where the failure happened. In using PyLint I've really wanted to be able to do the same thing, so that I can quickly and easily fix up issues shown by PyLint. I used to have to run PyLint on the command line with the output piped into a file, then open up a text editor and scroll through the output, and then go back to my code and find the issues.

However, I recently stumbled across a blog post about integrating pep8 into PyCharm, and I wondered about doing the same thing with PyLint. After some tweaking and messing, and whatnot, I finally figured out how to do it.

First, go and download the file from my scripts section.

Then, in PyCharm, open the settings and go down to the External Tools section. Add a new tool, and set the path to where you put, and set an argument and the working directory to the project path.

PyCharm Add External Tool

Before you close the dialog, click on the "Output Filters" button and add a filter, as below:

Edit Output Filter

Now you should be able to run PyLint from within PyCharm and click on the file names to be taken to the line in the file where that issue occurs.