Merge pull request #1377 from joshleeb/markdown-mdl-options

Add options for markdown_mdl linter
This commit is contained in:
w0rp
2018-03-03 13:16:27 +00:00
committed by GitHub
3 changed files with 34 additions and 3 deletions

View File

@@ -1,5 +1,8 @@
" Author: Steve Dignam <steve@dignam.xyz>
" Description: Support for mdl, a markdown linter
" Author: Steve Dignam <steve@dignam.xyz>, Josh Leeb-du Toit <joshleeb.com>
" Description: Support for mdl, a markdown linter.
call ale#Set('markdown_mdl_executable', 'mdl')
call ale#Set('markdown_mdl_options', '')
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
" matches: '(stdin):173: MD004 Unordered list style'
@@ -17,9 +20,17 @@ function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
return l:output
endfunction
function! ale_linters#markdown#mdl#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'markdown_mdl_executable')
let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
return l:executable . (!empty(l:options) ? ' ' . l:options : '')
endfunction
call ale#linter#Define('markdown', {
\ 'name': 'mdl',
\ 'executable': 'mdl',
\ 'command': 'mdl',
\ 'command_callback': 'ale_linters#markdown#mdl#GetCommand',
\ 'callback': 'ale_linters#markdown#mdl#Handle'
\})