summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorJosh Leeb-du Toit <josh.leebdutoit@gmail.com>2018-02-26 14:46:51 +1100
committerJosh Leeb-du Toit <josh.leebdutoit@gmail.com>2018-02-26 20:10:55 +1100
commit7e20d9c63996c9e189651bf687d921e5f20d12cf (patch)
tree0c27805f7eee874737ff0a5b34bbfbe4fd403251 /ale_linters
parent7ec684206c1395a940d8ad2d26d59773a432115c (diff)
downloadale-7e20d9c63996c9e189651bf687d921e5f20d12cf.zip
Add options for markdown_mdl linter
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/markdown/mdl.vim17
1 files changed, 14 insertions, 3 deletions
diff --git a/ale_linters/markdown/mdl.vim b/ale_linters/markdown/mdl.vim
index f2390250..9bb20318 100644
--- a/ale_linters/markdown/mdl.vim
+++ b/ale_linters/markdown/mdl.vim
@@ -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'
\})