How I integrated PyLint into my PyCharm workflow.

PyCharm has it’s own built-in linting, which is already useful and nicely integrated. However, it misses much that PyLint catches.

In this post I explain how I integrate PyLint into PyCharm as an external tool, with links from the PyLint results back to the python file.

Setting up PyLint as an External Tool in PyCharm

  1. Install PyLint and create a .pylintrc file (Reference: The docs).
  2. Setup PyCharm to run PyLint as an external tool (Reference: Stack Overflow)
  3. Edit the .pylintrc file to configure PyLint to print the full file path and line number as shown (The docs)

4. Configure PyCharm output filters to: .*$FILE_PATH$\:$LINE$\:.*

Then it will recognize filename:line_number as a link

Output Filter configuration is shown at the bottom of this picture:

5. Run your external tool and check that it works as expected, including the links:

How to run you PyLint external tool
PyLint Output

Additional Touches

  • Create several levels of PyLinting:
Several PyLint External Tools I created (by copying and modifying the first)

I generally lint for Errors and Warn/Refactor often, and only lint for Convention after the changes to a python file (that I’ll keep using) are several days old (and hence more stable).

  • The Grep console plugin can add some nice highlighting
  • I often work from the bottom PyLint link up, so that the earlier links still point to the correct lines.
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.