diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2018-05-01 19:29:06 -0300 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2018-05-01 19:49:45 -0300 |
commit | f11637b62b6d97be87d241476ebac9962a9a2a51 (patch) | |
tree | 19665b45e32d5707184aced08ecac2d798ec99c9 | |
parent | ae85695543c1e303ba062a5359a82c82cac53fd3 (diff) | |
download | ale-f11637b62b6d97be87d241476ebac9962a9a2a51.zip |
Add bundle option to mdl
-rw-r--r-- | ale_linters/markdown/mdl.vim | 6 | ||||
-rw-r--r-- | doc/ale-markdown.txt | 3 | ||||
-rw-r--r-- | test/command_callback/test_markdown_mdl_command_callback.vader | 7 |
3 files changed, 14 insertions, 2 deletions
diff --git a/ale_linters/markdown/mdl.vim b/ale_linters/markdown/mdl.vim index 16b08cc5..0953144b 100644 --- a/ale_linters/markdown/mdl.vim +++ b/ale_linters/markdown/mdl.vim @@ -10,9 +10,13 @@ endfunction function! ale_linters#markdown#mdl#GetCommand(buffer) abort let l:executable = ale_linters#markdown#mdl#GetExecutable(a:buffer) + let l:exec_args = l:executable =~? 'bundle$' + \ ? ' exec mdl' + \ : '' + let l:options = ale#Var(a:buffer, 'markdown_mdl_options') - return ale#Escape(l:executable) + return ale#Escape(l:executable) . l:exec_args \ . (!empty(l:options) ? ' ' . l:options : '') endfunction diff --git a/doc/ale-markdown.txt b/doc/ale-markdown.txt index d7e50093..63ddcae4 100644 --- a/doc/ale-markdown.txt +++ b/doc/ale-markdown.txt @@ -10,7 +10,8 @@ g:ale_markdown_mdl_executable *g:ale_markdown_mdl_executable* Type: |String| Default: `'mdl'` - See |ale-integrations-local-executables| + Override the invoked mdl binary. This is useful for running mdl from + binstubs or a bundle. g:ale_markdown_mdl_options *g:ale_markdown_mdl_options* diff --git a/test/command_callback/test_markdown_mdl_command_callback.vader b/test/command_callback/test_markdown_mdl_command_callback.vader index 3a68a4b2..2fb9a206 100644 --- a/test/command_callback/test_markdown_mdl_command_callback.vader +++ b/test/command_callback/test_markdown_mdl_command_callback.vader @@ -26,3 +26,10 @@ Execute(The executable and options should be configurable): AssertEqual \ ale_linters#markdown#mdl#GetCommand(bufnr('')), \ ale#Escape('foo bar') . ' --wat' + +Execute(Setting bundle appends 'exec mdl'): + let g:ale_markdown_mdl_executable = 'path to/bundle' + + AssertEqual + \ ale#Escape('path to/bundle') . ' exec mdl', + \ ale_linters#markdown#mdl#GetCommand(bufnr('')) |