How to use PyLint for Eclipse

Problems found and listed by PyLint in Eclipse
Problems found and listed by PyLint in Eclipse

Eclipse can be used to work with Python files by installing the PyDev plugin (by pulling it online or manually. PyLint can be used to improve the quality of Python code and to ensure it complies with PEP 8 guidelines.

To enable and use PyLint in Eclipse:

  • Install PyLint. For Python 2.x, this can be done from Ubuntu repositories. If you are using Python 3.x, then see this post.

  • Go to Window -> Preferences -> PyDev -> PyLint.

  • Enable the Use PyLint option.

  • By default, the output of PyLint is displayed as text in the Console view. Instead, the problems found by PyLint can be marked as errors or warnings in your editor window and listed in the Problems view. These options can be set in the same dialog.

  • Add the path to the PyLint executable.

  • Choose how you want the various problems reported by PyLint to be reported as: error, warning or information.

  • Click Apply, then OK. Restart Eclipse.

  • Now whenever you save a Python file, PyLint is executed. Its output is either shown in the Console view or marked out in the Editor and shown in the Problems view.

Note: If PyLint does not execute when you save a Python file, see this post on how to fix this issue.

Tried with: PyLint 1.4.0, Eclipse Luna 4.4.1 and Ubuntu 14.04


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.