File: markdownlint.vim

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (27 lines) | stat: -rw-r--r-- 1,016 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
" Description: Adds support for markdownlint

call ale#Set('markdown_markdownlint_executable', 'markdownlint')
call ale#Set('markdown_markdownlint_options', '')

function! ale_linters#markdown#markdownlint#GetExecutable(buffer) abort
    return ale#Var(a:buffer, 'markdown_markdownlint_executable')
endfunction

function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
    let l:executable = ale_linters#markdown#markdownlint#GetExecutable(a:buffer)

    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', {
\   'name': 'markdownlint',
\   'executable': function('ale_linters#markdown#markdownlint#GetExecutable'),
\   'lint_file': 1,
\   'output_stream': 'both',
\   'command': function('ale_linters#markdown#markdownlint#GetCommand'),
\   'callback': 'ale#handlers#markdownlint#Handle'
\})