diff options
Diffstat (limited to 'ale_linters/pug/puglint.vim')
-rw-r--r-- | ale_linters/pug/puglint.vim | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/ale_linters/pug/puglint.vim b/ale_linters/pug/puglint.vim index 165e68b7..63208986 100644 --- a/ale_linters/pug/puglint.vim +++ b/ale_linters/pug/puglint.vim @@ -5,12 +5,6 @@ call ale#Set('pug_puglint_options', '') call ale#Set('pug_puglint_executable', 'pug-lint') call ale#Set('pug_puglint_use_global', get(g:, 'ale_use_global_executables', 0)) -function! ale_linters#pug#puglint#GetExecutable(buffer) abort - return ale#node#FindExecutable(a:buffer, 'pug_puglint', [ - \ 'node_modules/.bin/pug-lint', - \]) -endfunction - function! s:FindConfig(buffer) abort for l:filename in [ \ '.pug-lintrc', @@ -29,19 +23,19 @@ function! s:FindConfig(buffer) abort endfunction function! ale_linters#pug#puglint#GetCommand(buffer) abort - let l:executable = ale_linters#pug#puglint#GetExecutable(a:buffer) let l:options = ale#Var(a:buffer, 'pug_puglint_options') let l:config = s:FindConfig(a:buffer) - return ale#Escape(l:executable) - \ . (!empty(l:options) ? ' ' . l:options : '') + return '%e' . ale#Pad(l:options) \ . (!empty(l:config) ? ' -c ' . ale#Escape(l:config) : '') \ . ' -r inline %t' endfunction call ale#linter#Define('pug', { \ 'name': 'puglint', -\ 'executable_callback': 'ale_linters#pug#puglint#GetExecutable', +\ 'executable_callback': ale#node#FindExecutableFunc('pug_puglint', [ +\ 'node_modules/.bin/pug-lint', +\ ]), \ 'output_stream': 'stderr', \ 'command_callback': 'ale_linters#pug#puglint#GetCommand', \ 'callback': 'ale#handlers#unix#HandleAsError', |