How I integrated PyLint into my PyCharm workflow.

Bruce Krayenhoff
2 min readJan 22, 2018

--

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.

This post seems to be a bit dated as of 2023 — you may also be interested in this newer post: How I Integrated Pipenv Pylint into my PyCharm workflow in 2023

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)
msg-template={abspath}:{line}: [{msg_id}({symbol}), {obj}] {msg}

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.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Bruce Krayenhoff
Bruce Krayenhoff

Written by Bruce Krayenhoff

I'm a machine learning scientist, a father, and a geek :). I'm passionate about personal improvement and improving the world.

Responses (4)

Write a response