summaryrefslogtreecommitdiff
path: root/ale_linters/vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-22 12:24:25 +0100
committerw0rp <devw0rp@gmail.com>2017-06-22 12:24:25 +0100
commit40f6ee4c395214a2d9a245b80c2019dd4e24b9b1 (patch)
tree1aa9c4fd445545438e1c2dd90462e624c9a3b042 /ale_linters/vim
parent93539e10de2a7ca309ec04150e0c61774e6f39db (diff)
downloadale-40f6ee4c395214a2d9a245b80c2019dd4e24b9b1.zip
Set the --no-color flag for Vint if we fail to parse the version number for some reason
Diffstat (limited to 'ale_linters/vim')
-rw-r--r--ale_linters/vim/vint.vim9
1 files changed, 5 insertions, 4 deletions
diff --git a/ale_linters/vim/vint.vim b/ale_linters/vim/vint.vim
index 2f506c20..18ae2e4c 100644
--- a/ale_linters/vim/vint.vim
+++ b/ale_linters/vim/vint.vim
@@ -6,9 +6,10 @@ let g:ale_vim_vint_show_style_issues =
\ get(g:, 'ale_vim_vint_show_style_issues', 1)
let s:enable_neovim = has('nvim') ? ' --enable-neovim ' : ''
let s:format = '-f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})"'
+let s:vint_version = []
function! ale_linters#vim#vint#VersionCommand(buffer) abort
- if !exists('s:vint_version')
+ if empty(s:vint_version)
" Check the Vint version if we haven't checked it already.
return 'vint --version'
endif
@@ -17,13 +18,13 @@ function! ale_linters#vim#vint#VersionCommand(buffer) abort
endfunction
function! ale_linters#vim#vint#GetCommand(buffer, version_output) abort
- if !empty(a:version_output)
+ if empty(s:vint_version) && !empty(a:version_output)
" Parse the version out of the --version output.
let s:vint_version = ale#semver#Parse(join(a:version_output, "\n"))
endif
- let l:can_use_no_color_flag = exists('s:vint_version')
- \ && ale#semver#GreaterOrEqual(s:vint_version, [0, 3, 7])
+ let l:can_use_no_color_flag = empty(s:vint_version)
+ \ || ale#semver#GreaterOrEqual(s:vint_version, [0, 3, 7])
let l:warning_flag = ale#Var(a:buffer, 'vim_vint_show_style_issues') ? '-s' : '-w'