summaryrefslogtreecommitdiff
path: root/ale_linters/vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-03-11 19:45:33 +0000
committerw0rp <devw0rp@gmail.com>2017-03-11 19:45:33 +0000
commitca78e4c150645ac2a257777d785f710351e93af1 (patch)
treef99832f0d2d27905dc0abaa5f640e746fe5e29de /ale_linters/vim
parent892fff03cc11cf0e1ebfabbec1839366afb4ba6c (diff)
downloadale-ca78e4c150645ac2a257777d785f710351e93af1.zip
Support older versions of Vint
Diffstat (limited to 'ale_linters/vim')
-rw-r--r--ale_linters/vim/vint.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/ale_linters/vim/vint.vim b/ale_linters/vim/vint.vim
index 9917f3fe..fb177b92 100644
--- a/ale_linters/vim/vint.vim
+++ b/ale_linters/vim/vint.vim
@@ -6,6 +6,8 @@ let g:ale_vim_vint_show_style_issues =
\ get(g:, 'ale_vim_vint_show_style_issues', 1)
let s:warning_flag = g:ale_vim_vint_show_style_issues ? '-s' : '-w'
+let s:vint_version = ale#semver#Parse(system('vint --version'))
+let s:has_no_color_support = ale#semver#GreaterOrEqual(s:vint_version, [3, 0, 7])
let s:enable_neovim = has('nvim') ? ' --enable-neovim ' : ''
let s:format = '-f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})"'
@@ -13,8 +15,8 @@ call ale#linter#Define('vim', {
\ 'name': 'vint',
\ 'executable': 'vint',
\ 'command': 'vint '
-\ . s:warning_flag
-\ . ' --no-color '
+\ . s:warning_flag . ' '
+\ . (s:has_no_color_support ? '--no-color ' : '')
\ . s:enable_neovim
\ . s:format
\ . ' %t',