diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | ale_linters/markdown/mdl.vim | 35 | ||||
-rw-r--r-- | doc/ale.txt | 1 |
3 files changed, 37 insertions, 0 deletions
@@ -45,6 +45,7 @@ name. That seems to be the fairest way to arrange this table. | JavaScript | [eslint](http://eslint.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/) | | JSON | [jsonlint](http://zaa.ch/jsonlint/) | | Lua | [luacheck](https://github.com/mpeterv/luacheck) | +| Markdown | [mdl](https://github.com/mivok/markdownlint) | | MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) | | Perl | [perl -c](https://perl.org/), [perl-critic](https://metacpan.org/pod/Perl::Critic) | | PHP | [php -l](https://secure.php.net/), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) | diff --git a/ale_linters/markdown/mdl.vim b/ale_linters/markdown/mdl.vim new file mode 100644 index 00000000..c984252e --- /dev/null +++ b/ale_linters/markdown/mdl.vim @@ -0,0 +1,35 @@ +" Author: Steve Dignam <steve@dignam.xyz> +" Description: Support for mdl, a markdown linter + +function! ale_linters#markdown#mdl#Handle(buffer, lines) abort + " matches: '(stdin):173: MD004 Unordered list style' + let l:pattern = ':\(\d*\): \(.*\)$' + let l:output = [] + + for l:line in a:lines + let l:match = matchlist(l:line, l:pattern) + + if len(l:match) == 0 + continue + endif + + call add(l:output, { + \ 'bufnr': a:buffer, + \ 'lnum': l:match[1] + 0, + \ 'vcol': 0, + \ 'col': 0, + \ 'text': l:match[2], + \ 'type': 'W', + \ 'nr': -1, + \}) + endfor + + return l:output +endfunction + +call ale#linter#Define('markdown', { +\ 'name': 'mdl', +\ 'executable': 'mdl', +\ 'command': 'mdl', +\ 'callback': 'ale_linters#markdown#mdl#Handle' +\}) diff --git a/doc/ale.txt b/doc/ale.txt index c1abaa78..17067617 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -67,6 +67,7 @@ The following languages and tools are supported. * JavaScript: 'eslint', 'jscs', 'jshint' * JSON: 'jsonlint' * Lua: 'luacheck' +* Markdown: 'mdl' * MATLAB: 'mlint' * Perl: 'perl' (-c flag), 'perlcritic' * PHP: 'php' (-l flag), 'phpcs' |