diff --git a/HOWTO.md b/HOWTO.md deleted file mode 100644 index 9c34f04..0000000 --- a/HOWTO.md +++ /dev/null @@ -1,32 +0,0 @@ -Creating a Linter Plugin -======================== - -- Click "use this template" 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](https://github.com/SublimeLinter/package_control_channel) to make it available to others. - -Additional documentation can be found at [sublimelinter.com](http://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 `cmd` attribute 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 make `cmd` a method (or callable in python speak) which returns such a tuple. - -- Change the `regex` attribute to correctly capture the error output from the linter. - -- Change the `multiline` attribute to `True` if the regex parses multiline error messages. - -Other, optional, attributes include: - -- If the linter executable does not accept input via `stdin`, set the `tempfile_suffix` attribute to the filename suffix of the temp files that will be created. - -- If the linter outputs errors only on `stderr` or `stdout`, set `error_stream` to `util.STREAM_STDERR` or `util.STREAM_STDOUT` respectively. - -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](https://github.com/SublimeLinter/SublimeLinter/blob/master/docs/linter_attributes.rst). diff --git a/README.md b/README.md index 96f0868..3688d52 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,21 @@ -This is a template. For "how to make a linter", please check [the HOWTO](HOWTO.md). +SublimeLinter-csl +================= ------------------------------------------------------------------ +[![Build Status](https://travis-ci.org/SublimeLinter/SublimeLinter-csl.svg?branch=master)](https://travis-ci.org/SublimeLinter/SublimeLinter-csl) -SublimeLinter-contrib-__linter__ -================================ - -[![Build Status](https://travis-ci.org/SublimeLinter/SublimeLinter-contrib-__linter__.svg?branch=master)](https://travis-ci.org/SublimeLinter/SublimeLinter-contrib-__linter__) - -This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to [__linter__](__linter_homepage__). It will be used with files that have the “__syntax__” syntax. +This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to the [csl-validator.sh](https://github.com/citation-style-language/utilities) script. It will be used with files that have the Citation Style Language (CSL) syntax. ## Installation -SublimeLinter must be installed in order to use this plugin. +SublimeLinter must be installed in order to use this plugin. Please use [Package Control](https://packagecontrol.io) to install the linter plugin. -Before installing this plugin, you must ensure that `__linter__` is installed on your system. +Before installing this plugin, you must ensure that the `csl-validator.sh` script from https://github.com/citation-style-language/utilities is available on your system. This further requires the `curl` and `jq` utilities. -In order for `__linter__` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. The docs cover [troubleshooting PATH configuration](http://sublimelinter.readthedocs.io/en/latest/troubleshooting.html#finding-a-linter-executable). +In order for `csl-validator.sh` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. The docs cover [troubleshooting PATH configuration](http://sublimelinter.readthedocs.io/en/latest/troubleshooting.html#finding-a-linter-executable). ## Settings - SublimeLinter settings: http://sublimelinter.readthedocs.org/en/latest/settings.html - Linter settings: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html -Additional SublimeLinter-__linter__ settings: - -|Setting|Description | -|:------|:--------------| -|foo |Something. | -|bar |Something else.| +There are no specific settings for `csl-validator.sh` nor this plugin. diff --git a/linter.py b/linter.py index 4841e0d..aa5b8ef 100644 --- a/linter.py +++ b/linter.py @@ -1,10 +1,8 @@ -from SublimeLinter.lint import Linter # or NodeLinter, PythonLinter, ComposerLinter, RubyLinter +from SublimeLinter.lint import Linter - -class __class__(Linter): - cmd = '__cmd__' - regex = r'' - multiline = False +class SublimeLinterCsl (Linter): + cmd = 'csl-validator.sh' + regex = r'^M="(?P.+)" L=(?P\d+) C=(?P\d+)$' defaults = { - 'selector': 'source.python' + 'selector': 'source.csl, text.xml' } diff --git a/messages/install.txt b/messages/install.txt index 81f2de4..9a0d18c 100644 --- a/messages/install.txt +++ b/messages/install.txt @@ -1,6 +1,6 @@ -SublimeLinter-contrib-__linter__ -------------------------------- -This linter plugin for SublimeLinter provides an interface to __linter__. +SublimeLinter-csl +----------------- +This linter plugin for SublimeLinter provides an interface to `csl-validator.sh`. For more information, please see: -https://github.com/__user__/SublimeLinter-contrib-__linter__ +https://github.com/Marcool04/SublimeLinter-csl