biermeester / Pylinter

A pylint plugin for Sublime Text 2 and 3
157 stars 39 forks source link

Pylinter Sublime Text 2/3 Plugin

Introduction

This is a small plugin for Sublime Text 2 and 3 that allows automatic Python source code checking by Pylint.

Since Pylint can take a while before it has completed its task (multiple seconds), it is run from a separate thread, so the plugin won't lock up Sublime Text.

The plugin can be automatically invoked on save or by a keyboard shortcut.

Support for Pylint configuration files is included.

Note::

** Pylint needs to be installed separately!!! **

If you have installed Pylint into a Virtualenv, you need to launch Sublime
Text from that Virtualenv for everything to work correctly. This might be
resolved in the future.

Latest changes

2014-03-03

Added support for Pylint plugins. You can add a list of plugin module names into your configuration using the plugins setting.

2013-11-15

Some refactoring has been done to make sure Pylinter works better under ST3. Also, the error handling, in case Pylint cannot be found, is improved.

2013-09-06

Improved Pylint detection and a Pylint version check bug fix.

2013-09-01

This is the first version of Pylinter that is both compatible with Sublime Text 2 and 3. Please feel free to report any issues. And many thank-yous to everyone reporting issues and supplying solutions in regards to Python 3 compatibility.

2013-08-24

Thanks to dbader for the Pylint 1.0 support

2013-01-20

Thanks to KristoforMaynard for the following additions:

2012-09-12

2012-09-06

2012-08-31

2012-08-29

Configuration

Pylinter will try and determine the path to Pylint. If it fails you must provide a full path to the lint.py module of your Pylint installation!

Multiconf


Any setting can be replaced by a Multiconf structure ::

    "pylint_path": {
        "#multiconf#": [
            {"os:windows": "<your windows pylint path>"},
            {"os:linux;host:<host name": "<your linux pylint path>"},
            {"os:linux;host:<other host name": "<your other linux pylint path>"}
        ]
      }

For more information you can have a look at the following `gist`_.

Project settings

You may also store settings in your *.sublime-project files. Create a "pylinter" section as shown below and override any or all of the described settings::

{
    "folders":
    [
        {
            "path": "/N/development/fabrix"
        }
    ],
    "settings":
    {
        "pylinter":
        {
        }
    }
}

Commands & Keyboard Shortcuts

Run

The plugin can be invoked by a keyboard shortcut:

Add pylint ignore comment/statement

Add a 'Pylint disable' comment to the end of the line with an error code in it, so it will be ignored on the next check.

Toggle Marking

The marking of the errors in the file can be toggled off and on:

Quick List

To see a quick list of all the Pylint errors use:

.. _gist: https://gist.github.com/3646966 .. _Yusuke Kamiyamane: http://p.yusukekamiyamane.com/