File: protolint.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 (26 lines) | stat: -rw-r--r-- 783 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
" Author: Yohei Yoshimuta <yoheimuta@gmail.com>
" Description: Integration of protolint with ALE.

call ale#Set('proto_protolint_executable', 'protolint')
call ale#Set('proto_protolint_config', '')

function! ale#fixers#protolint#GetExecutable(buffer) abort
    let l:executable = ale#Var(a:buffer, 'proto_protolint_executable')

    return ale#Escape(l:executable)
endfunction

function! ale#fixers#protolint#Fix(buffer) abort
    let l:executable = ale#fixers#protolint#GetExecutable(a:buffer)
    let l:config = ale#Var(a:buffer, 'proto_protolint_config')

    return {
    \   'command': l:executable
    \       . (!empty(l:config) ? ' -config_path=' . ale#Escape(l:config) : '')
    \       . ' -fix'
    \       . ' %t',
    \   'read_temporary_file': 1,
    \}
endfunction