diff --git a/plugins/sublime/.gitignore b/plugins/sublime/.gitignore new file mode 100644 index 000000000..e43b0f988 --- /dev/null +++ b/plugins/sublime/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/plugins/sublime/.sublimelinterrc b/plugins/sublime/.sublimelinterrc new file mode 100644 index 000000000..10639f66a --- /dev/null +++ b/plugins/sublime/.sublimelinterrc @@ -0,0 +1,14 @@ +{ + "@python": 3, + "linters": { + "flake8": { + "max-line-length": 120 + }, + "pep257": { + "ignore": ["D202"] + }, + "pep8": { + "max-line-length": 120 + } + } +} diff --git a/plugins/sublime/.travis.yml b/plugins/sublime/.travis.yml new file mode 100644 index 000000000..ab757ff9a --- /dev/null +++ b/plugins/sublime/.travis.yml @@ -0,0 +1,11 @@ +language: python +python: + - "3.3" +# command to install dependencies +install: + - pip install flake8 + - pip install pep257 +# command to run tests +script: + - flake8 . --max-line-length=120 + - pep257 . --ignore=D202 diff --git a/plugins/sublime/LICENSE b/plugins/sublime/LICENSE new file mode 100644 index 000000000..89de35479 --- /dev/null +++ b/plugins/sublime/LICENSE @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/sublime/README.md b/plugins/sublime/README.md new file mode 100644 index 000000000..c5e7296cd --- /dev/null +++ b/plugins/sublime/README.md @@ -0,0 +1,73 @@ +SublimeLinter-contrib-proselint +================================ + +[![Build Status](https://travis-ci.org/SublimeLinter/SublimeLinter-contrib-proselint.svg?branch=master)](https://travis-ci.org/SublimeLinter/SublimeLinter-contrib-proselint) +very unique +This linter plugin for [SublimeLinter][docs] provides an interface to [proselint](__linter_homepage__). It will be used with files that have the “__syntax__” syntax. + +## Installation +SublimeLinter 3 must be installed in order to use this plugin. If SublimeLinter 3 is not installed, please follow the instructions [here][installation]. +abbeviatable +### Linter installation +Before using this plugin, you must ensure that `proselint` is installed on your system. To install `proselint`, do the following: + +1. Install [Python](http://python.org/download/) and [pip](http://www.pip-installer.org/en/latest/installing.html). + +1. Install `proselint` by typing the following in a terminal: + ``` + [sudo] pip install proselint + ``` + + +**Note:** This plugin requires `proselint` __version__ or later. + +### Linter configuration +In order for `proselint` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. Before going any further, please read and follow the steps in [“Finding a linter executable”](http://sublimelinter.readthedocs.org/en/latest/troubleshooting.html#finding-a-linter-executable) through “Validating your PATH” in the documentation. + +Once you have installed and configured `proselint`, you can proceed to install the SublimeLinter-contrib-proselint plugin if it is not yet installed. + +### Plugin installation +Please use [Package Control][pc] to install the linter plugin. This will ensure that the plugin will be updated when new versions are available. If you want to install from source so you can modify the source code, you probably know what you are doing so we won’t cover that here. + +To install via Package Control, do the following: + +1. Within Sublime Text, bring up the [Command Palette][cmd] and type `install`. Among the commands you should see `Package Control: Install Package`. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins. + +1. When the plugin list appears, type `proselint`. Among the entries you should see `SublimeLinter-contrib-proselint`. If that entry is not highlighted, use the keyboard or mouse to select it. + +## Settings +For general information on how SublimeLinter works with settings, please see [Settings][settings]. For information on generic linter settings, please see [Linter Settings][linter-settings]. + +In addition to the standard SublimeLinter settings, SublimeLinter-contrib-proselint provides its own settings. Those marked as “Inline Setting” or “Inline Override” may also be [used inline][inline-settings]. + +|Setting|Description|Inline Setting|Inline Override| +|:------|:----------|:------------:|:-------------:| +|foo|Something.|✓| | +|bar|Something else.| |✓| + +## Contributing +If you would like to contribute enhancements or fixes, please do the following: + +1. Fork the plugin repository. +1. Hack on a separate topic branch created from the latest `master`. +1. Commit and push the topic branch. +1. Make a pull request. +1. Be patient. ;-) + +Please note that modifications should follow these coding guidelines: + +- Indent is 4 spaces. +- Code should pass flake8 and pep257 linters. +- Vertical whitespace helps readability, don’t be afraid to use it. +- Please use descriptive variable names, no abbreviations unless they are very well known. + +Thank you for helping out! + +[docs]: http://sublimelinter.readthedocs.org +[installation]: http://sublimelinter.readthedocs.org/en/latest/installation.html +[locating-executables]: http://sublimelinter.readthedocs.org/en/latest/usage.html#how-linter-executables-are-located +[pc]: https://sublime.wbond.net/installation +[cmd]: http://docs.sublimetext.info/en/sublime-text-3/extensibility/command_palette.html +[settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html +[linter-settings]: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html +[inline-settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html#inline-settings diff --git a/plugins/sublime/linter.py b/plugins/sublime/linter.py new file mode 100644 index 000000000..131f9f832 --- /dev/null +++ b/plugins/sublime/linter.py @@ -0,0 +1,37 @@ +# +# linter.py +# Linter for SublimeLinter3, a code checking framework for Sublime Text 3 +# +# Written by Jordan Suchow +# Copyright (c) 2015 Jordan Suchow +# +# License: MIT +# + +"""This module exports the Proselint plugin class.""" + +from SublimeLinter.lint import Linter, util + + +class Proselint(Linter): + + """Provides an interface to proselint.""" + + syntax = ('html', 'markdown', 'plain text') + cmd = 'proselint' + executable = None + version_args = '--version' + version_re = r'(?P\d+\.\d+\.\d+)' + version_requirement = '>= 0.0.0' + regex = ( + r'^.+?:(?P\d+):(?P\d+): (?P.+)' + ) + multiline = True + line_col_base = (1, 1) + tempfile_suffix = 'pltmp' + selectors = {} + word_re = None + defaults = {} + inline_settings = None + inline_overrides = None + comment_re = None diff --git a/plugins/sublime/messages.json b/plugins/sublime/messages.json new file mode 100644 index 000000000..ef56f9e6b --- /dev/null +++ b/plugins/sublime/messages.json @@ -0,0 +1,3 @@ +{ + "install": "messages/install.txt" +} diff --git a/plugins/sublime/messages/install.txt b/plugins/sublime/messages/install.txt new file mode 100644 index 000000000..40a00cb51 --- /dev/null +++ b/plugins/sublime/messages/install.txt @@ -0,0 +1,10 @@ +SublimeLinter-contrib-proselint +------------------------------- +This linter plugin for SublimeLinter provides an interface to proselint. + +** IMPORTANT! ** + +Before this plugin will activate, you *must* +follow the installation instructions here: + +https://github.com/Jordan Suchow/SublimeLinter-contrib-proselint