1
0
Fork 0
mirror of synced 2024-11-23 01:05:34 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/markdown/markdownlint.vim

28 lines
1,016 B
VimL
Raw Normal View History

" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
" Description: Adds support for markdownlint
2022-12-03 05:29:32 -05:00
call ale#Set('markdown_markdownlint_executable', 'markdownlint')
2020-12-04 16:15:32 -05:00
call ale#Set('markdown_markdownlint_options', '')
2022-12-03 05:29:32 -05:00
function! ale_linters#markdown#markdownlint#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'markdown_markdownlint_executable')
endfunction
2020-12-04 16:15:32 -05:00
function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
2022-12-03 05:29:32 -05:00
let l:executable = ale_linters#markdown#markdownlint#GetExecutable(a:buffer)
2020-12-04 16:15:32 -05:00
let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options')
return ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
endfunction
call ale#linter#Define('markdown', {
2019-03-08 06:04:56 -05:00
\ 'name': 'markdownlint',
2022-12-03 05:29:32 -05:00
\ 'executable': function('ale_linters#markdown#markdownlint#GetExecutable'),
2019-03-08 06:04:56 -05:00
\ 'lint_file': 1,
\ 'output_stream': 'both',
2020-12-04 16:15:32 -05:00
\ 'command': function('ale_linters#markdown#markdownlint#GetCommand'),
2019-03-08 06:04:56 -05:00
\ 'callback': 'ale#handlers#markdownlint#Handle'
\})