All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 " Author rhysd https://rhysd.github.io/, Dirk Roorda (dirkroorda), Adrián González Rus (@adrigzr)
3 " Description: remark-lint for Markdown files
4 call ale#Set('markdown_remark_lint_executable', 'remark')
5 call ale#Set('markdown_remark_lint_use_global', get(g:, 'ale_use_global_executables', 0))
6 call ale#Set('markdown_remark_lint_options', '')
8 function! ale_linters#markdown#remark_lint#GetCommand(buffer) abort
9 let l:options = ale#Var(a:buffer, 'markdown_remark_lint_options')
11 return '%e' . ale#Pad(l:options) . ' --no-stdout --no-color'
14 function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
15 " matches: ' 1:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint'
16 " matches: ' 18:71-19:1 error Missing new line after list item list-item-spacing remark-lint',
17 let l:pattern = '^ \+\(\d\+\):\(\d\+\)\(-\(\d\+\):\(\d\+\)\)\? \(warning\|error\) \(.\+\)$'
20 for l:match in ale#util#GetMatches(a:lines, l:pattern)
22 \ 'lnum': l:match[1] + 0,
23 \ 'col': l:match[2] + 0,
24 \ 'type': l:match[6] is# 'error' ? 'E' : 'W',
28 if l:match[3] isnot# ''
29 let l:item.end_lnum = l:match[4] + 0
30 let l:item.end_col = l:match[5] + 0
33 call add(l:output, l:item)
39 call ale#linter#Define('markdown', {
40 \ 'name': 'remark_lint',
41 \ 'aliases': ['remark-lint'],
42 \ 'executable': {b -> ale#path#FindExecutable(b, 'markdown_remark_lint', [
43 \ 'node_modules/.bin/remark',
45 \ 'command': function('ale_linters#markdown#remark_lint#GetCommand'),
46 \ 'callback': 'ale_linters#markdown#remark_lint#Handle',
47 \ 'output_stream': 'stderr',