├── .gitignore ├── messages ├── 2.0.0.txt ├── 2.1.0.txt ├── 2.2.0.txt └── install.txt ├── messages.json ├── .travis.yml ├── .sublimelinterrc ├── LICENSE ├── linter.py └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /messages/2.0.0.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-write-good 2 | ------------------------------- 3 | 4 | - Now only lints code comments 5 | -------------------------------------------------------------------------------- /messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "install": "messages/install.txt", 3 | "2.0.0": "messages/2.0.0.txt", 4 | "2.1.0": "messages/2.1.0.txt" 5 | } 6 | -------------------------------------------------------------------------------- /messages/2.1.0.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-write-good 2 | ------------------------------- 3 | 4 | - Now lints text scopes in addition to code comments 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | # command to install dependencies 3 | install: 4 | - pip install flake8 5 | - pip install pydocstyle 6 | # command to run tests 7 | script: 8 | - flake8 . --max-line-length=120 9 | - pydocstyle . --add-ignore=D202 10 | -------------------------------------------------------------------------------- /messages/2.2.0.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-write-good 2 | ------------------------------- 3 | 4 | - No longer lints your source code! That was annoying. 5 | - Uses a local version of write-good if its found. 6 | - Now checks to make sure you've got write-good 0.9.0 or newer. -------------------------------------------------------------------------------- /.sublimelinterrc: -------------------------------------------------------------------------------- 1 | { 2 | "@python": 3, 3 | "linters": { 4 | "flake8": { 5 | "max-line-length": 120 6 | }, 7 | "pep257": { 8 | "ignore": ["D202"] 9 | }, 10 | "pep8": { 11 | "max-line-length": 120 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /messages/install.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-write-good 2 | ------------------------------- 3 | This linter plugin for SublimeLinter provides an interface to write-good. 4 | 5 | ** IMPORTANT! ** 6 | 7 | Before this plugin will activate, you *must* 8 | follow the installation instructions here: 9 | 10 | https://github.com/ckaznocha/SublimeLinter-contrib-write-good 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /linter.py: -------------------------------------------------------------------------------- 1 | # 2 | # linter.py 3 | # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 4 | # 5 | # Written by Clifton Kaznocha 6 | # Copyright (c) 2014 Clifton Kaznocha 7 | # 8 | # License: MIT 9 | # 10 | """This module exports the WriteGood plugin class.""" 11 | import SublimeLinter 12 | from SublimeLinter.lint import NodeLinter 13 | 14 | 15 | if getattr(SublimeLinter.lint, 'VERSION', 3) > 3: 16 | from SublimeLinter.lint import const 17 | WARNING = const.WARNING 18 | else: 19 | from SublimeLinter.lint import highlight 20 | WARNING = highlight.WARNING 21 | 22 | 23 | class WriteGood(NodeLinter): 24 | """Provides an interface to write-good.""" 25 | 26 | cmd = ('write-good') 27 | npm_name = 'write-good' 28 | version_args = '--version' 29 | version_re = r'(?P\d+\.\d+\.\d+)' 30 | version_requirement = ">=0.9.0" 31 | regex = r'''(?xi) 32 | ^(?P(?P"[^"]*").*)\son\sline\s(?P\d+)\sat\scolumn\s\d+$ 33 | ''' 34 | multiline = True 35 | default_type = WARNING 36 | defaults = { 37 | "selector": 'text.html.markdown, text.plain, text.tex.latex, comment' 38 | } 39 | tempfile_suffix = '.tmp' 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-write-good 2 | ================================ 3 | 4 | [![Build Status](https://travis-ci.org/ckaznocha/SublimeLinter-contrib-write-good.svg?branch=master)](https://travis-ci.org/ckaznocha/SublimeLinter-contrib-write-good) 5 | 6 | This linter plugin for [SublimeLinter][docs] provides an interface to [write-good](https://github.com/btford/write-good). It will be used with files that have English prose. 7 | 8 | ## Installation 9 | SublimeLinter 3 must be installed in order to use this plugin. If SublimeLinter 3 is not installed, please follow the instructions [here][installation]. 10 | 11 | ### Linter installation 12 | Before using this plugin, you must ensure that `write-good` is installed on your system. To install `write-good`, do the following: 13 | 14 | 15 | 1. Install [Node.js](http://nodejs.org) (and [npm](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) on Linux). 16 | 17 | 1. Install `write-good` by typing the following in a terminal: 18 | ``` 19 | npm install -g write-good 20 | ``` 21 | 22 | 1. If you are using `nvm` and `zsh`, ensure that the line to load `nvm` is in `.zshenv` and not `.zshrc`. 23 | 24 | 1. If a local version of write-good is available it will be used before trying to find the system version. 25 | 26 | ### Linter configuration 27 | In order for `write-good` 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. 28 | 29 | Once you have installed and configured `write-good`, you can proceed to install the SublimeLinter-contrib-write-good plugin if it is not yet installed. 30 | 31 | ### Plugin installation 32 | 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. 33 | 34 | To install via Package Control, do the following: 35 | 36 | 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. 37 | 38 | 1. When the plugin list appears, type `write-good`. Among the entries you should see `SublimeLinter-contrib-write-good`. If that entry is not highlighted, use the keyboard or mouse to select it. 39 | 40 | ## Settings 41 | 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]. 42 | 43 | 44 | ## Contributing 45 | If you would like to contribute enhancements or fixes, please do the following: 46 | 47 | 1. Fork the plugin repository. 48 | 1. Hack on a separate topic branch created from the latest `master`. 49 | 1. Commit and push the topic branch. 50 | 1. Make a pull request. 51 | 1. Be patient. ;-) 52 | 53 | Please note that modifications should follow these coding guidelines: 54 | 55 | - Indent is 4 spaces. 56 | - Code should pass flake8 and pep257 linters. 57 | - Vertical whitespace helps readability, don’t be afraid to use it. 58 | - Please use descriptive variable names, no abbreviations unless they are very well known. 59 | 60 | Thank you for helping out! 61 | 62 | ### Maintainers 63 | 64 | - [@ChrisCummins](https://github.com/ChrisCummins) 65 | - [@ckaznocha](https://github.com/ckaznocha) (inactive) 66 | 67 | [docs]: http://sublimelinter.readthedocs.org 68 | [installation]: http://sublimelinter.readthedocs.org/en/latest/installation.html 69 | [locating-executables]: http://sublimelinter.readthedocs.org/en/latest/usage.html#how-linter-executables-are-located 70 | [pc]: https://sublime.wbond.net/installation 71 | [cmd]: http://docs.sublimetext.info/en/sublime-text-3/extensibility/command_palette.html 72 | [settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html 73 | [linter-settings]: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html 74 | [inline-settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html#inline-settings 75 | --------------------------------------------------------------------------------