1.8 KiB
Executable file
Creating a Linter Plugin
- Fork this repo to bootstrap your new linter.
- Clone it into Packages.
- Change a linter.py.
- Update the README and replace
__linter__placeholders. - Update messages/install.txt and replace
__linter__placeholders. - Open a PR in our package_control repo to make it available to others.
Additional documentation can be found at sublimelinter.com.
Updating class attributes
Template linter plugins are created with almost all of the Linter class attributes filled in with the default values. To make your new linter plugin functional, at the very least you need to do the following:
-
Change the default
'selector'to include the scopes you want the linter to lint. -
Change the
cmdattribute to include the executable and arguments you want to include on every run. Usually this should be a tuple like('linter', '-fooarg', '-etc', '-'). You can also makecmda method (or callable in python speak) which returns such a tuple. -
Change the
regexattribute to correctly capture the error output from the linter. -
Change the
multilineattribute toTrueif the regex parses multiline error messages.
Other, optional, attributes include:
-
If the linter executable does not accept input via
stdin, set thetempfile_suffixattribute to the filename suffix of the temp files that will be created. -
If the linter outputs errors only on
stderrorstdout, seterror_streamtoutil.STREAM_STDERRorutil.STREAM_STDOUTrespectively.
You should remove attributes that you do not change, as their values will be provided by the superclass. More information can be found in the docs.