ale/ale_linters/vim/vint.vim

30 lines
1.1 KiB
VimL
Raw Normal View History

" Author: w0rp <devw0rp@gmail.com>, KabbAmine <amine.kabb@gmail.com>
" Description: This file adds support for checking Vim code with Vint.
" This flag can be used to change enable/disable style issues.
let g:ale_vim_vint_show_style_issues =
\ get(g:, 'ale_vim_vint_show_style_issues', 1)
2017-03-11 19:45:33 +00:00
let s:vint_version = ale#semver#Parse(system('vint --version'))
let s:has_no_color_support = ale#semver#GreaterOrEqual(s:vint_version, [0, 3, 7])
let s:enable_neovim = has('nvim') ? ' --enable-neovim ' : ''
2016-10-10 19:21:12 +00:00
let s:format = '-f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})"'
function! ale_linters#vim#vint#GetCommand(buffer) abort
let l:warning_flag = g:ale_vim_vint_show_style_issues ? '-s' : '-w'
return 'vint '
\ . l:warning_flag . ' '
\ . (s:has_no_color_support ? '--no-color ' : '')
\ . s:enable_neovim
\ . s:format
\ . ' %t'
endfunction
call ale#linter#Define('vim', {
\ 'name': 'vint',
\ 'executable': 'vint',
\ 'command_callback': 'ale_linters#vim#vint#GetCommand',
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\})