summaryrefslogtreecommitdiff
path: root/ale_linters/markdown
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-08-02 23:44:12 +0100
committerw0rp <devw0rp@gmail.com>2018-08-02 23:44:12 +0100
commit217284360d35711b751859ed27a7a3c3da300e85 (patch)
tree4b26a84b397e3ac15a8b13a572b1f9a50312dbab /ale_linters/markdown
parent9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff)
downloadale-217284360d35711b751859ed27a7a3c3da300e85.zip
Simplify the code for most linters and tests with closures
Diffstat (limited to 'ale_linters/markdown')
-rw-r--r--ale_linters/markdown/remark_lint.vim15
1 files changed, 4 insertions, 11 deletions
diff --git a/ale_linters/markdown/remark_lint.vim b/ale_linters/markdown/remark_lint.vim
index d9c2efb6..88dfb9dd 100644
--- a/ale_linters/markdown/remark_lint.vim
+++ b/ale_linters/markdown/remark_lint.vim
@@ -5,19 +5,10 @@ call ale#Set('markdown_remark_lint_executable', 'remark')
call ale#Set('markdown_remark_lint_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('markdown_remark_lint_options', '')
-function! ale_linters#markdown#remark_lint#GetExecutable(buffer) abort
- return ale#node#FindExecutable(a:buffer, 'markdown_remark_lint', [
- \ 'node_modules/.bin/remark',
- \])
-endfunction
-
function! ale_linters#markdown#remark_lint#GetCommand(buffer) abort
- let l:executable = ale_linters#markdown#remark_lint#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'markdown_remark_lint_options')
- return ale#node#Executable(a:buffer, l:executable)
- \ . (!empty(l:options) ? ' ' . l:options : '')
- \ . ' --no-stdout --no-color'
+ return '%e' . ale#Pad(l:options) . ' --no-stdout --no-color'
endfunction
function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
@@ -46,7 +37,9 @@ endfunction
call ale#linter#Define('markdown', {
\ 'name': 'remark_lint',
\ 'aliases': ['remark-lint'],
-\ 'executable_callback': 'ale_linters#markdown#remark_lint#GetExecutable',
+\ 'executable_callback': ale#node#FindExecutableFunc('markdown_remark_lint', [
+\ 'node_modules/.bin/remark',
+\ ]),
\ 'command_callback': 'ale_linters#markdown#remark_lint#GetCommand',
\ 'callback': 'ale_linters#markdown#remark_lint#Handle',
\ 'output_stream': 'stderr',