summaryrefslogtreecommitdiff
path: root/ale_linters/markdown/mdl.vim
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-03-03 13:16:27 +0000
committerGitHub <noreply@github.com>2018-03-03 13:16:27 +0000
commit857723e7d569c8260d95d2ce261fbf064e5bfa9f (patch)
tree04356e1c58a29e0be8e19490148820f42783614f /ale_linters/markdown/mdl.vim
parent8a772905539ccfe306219addae5a506def88fe44 (diff)
parent7e20d9c63996c9e189651bf687d921e5f20d12cf (diff)
downloadale-857723e7d569c8260d95d2ce261fbf064e5bfa9f.zip
Merge pull request #1377 from joshleeb/markdown-mdl-options
Add options for markdown_mdl linter
Diffstat (limited to 'ale_linters/markdown/mdl.vim')
-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'
\})