Pylinting with PyCharm

Kiran Koduru • May 6, 2017 • 1 minutes to read

If you have worked with PyCharm, you will have noticed the inspections plugin which performs static analysis on your code is very effective in finding PEP-8 errors. But it fails in some places and can be replaced by pylint . This tutorial will guide you through a step by step walkthrough of setting up pylint in PyCharm.

1. Locate your pylint installation

To find out where is pylint on most unix OS you can type the following in your command line.

$ which pylint /usr/local/bin/pylint

If you don’t have pylint installed then try the command abover after installing pylint via pip.

$ pip install pylint

You can find the External Tools options from the

File -> Settings Typing External Tools in the search bar

or

Pressing Ctrl + Alt + S on your keyboard Typing External Tools in the search bar

You can read more about External Tools here.

Click the + icon in the External Tools window and configure using the following information. Make sure that Program value is set to the output from Step 1.

4. Finally run pylint

Run pylint from External Tools via Tools -> External Tools -> pylint dropdown.

5. View your output in PyCharm console

After your run from Step 4, you can view your pylint score in your PyCharm console.