summaryrefslogtreecommitdiff
path: root/ale_linters/vala
diff options
context:
space:
mode:
authorAtsuya Takagi <asoftonight@gmail.com>2021-01-04 16:00:30 +0900
committerAtsuya Takagi <asoftonight@gmail.com>2021-01-23 00:08:01 +0900
commit89403b4a0600011ad94d51a7aef9e26afe284fd6 (patch)
treee409e1eecaacf09805cbf4c204758c847ba83300 /ale_linters/vala
parent280d2dedaeba09aad139e9b2c6ea37e3213083b4 (diff)
downloadale-89403b4a0600011ad94d51a7aef9e26afe284fd6.zip
expect warn or error
Diffstat (limited to 'ale_linters/vala')
-rw-r--r--ale_linters/vala/vala_lint.vim9
1 files changed, 6 insertions, 3 deletions
diff --git a/ale_linters/vala/vala_lint.vim b/ale_linters/vala/vala_lint.vim
index b53e9b86..a38bf9bf 100644
--- a/ale_linters/vala/vala_lint.vim
+++ b/ale_linters/vala/vala_lint.vim
@@ -13,7 +13,7 @@ function! ale_linters#vala#vala_lint#GetCommand(buffer) abort
endfunction
function! ale_linters#vala#vala_lint#Handle(buffer, lines) abort
- let l:pattern = '^\s*\(\d\+\)\.\(\d\+\)\s\+\(\w\+\)\s\+\(.\+\)\s\([A-Za-z0-9_\-]\+\)'
+ let l:pattern = '^\s*\(\d\+\)\.\(\d\+\)\s\+\(error\|warn\)\s\+\(.\+\)\s\([A-Za-z0-9_\-]\+\)'
let l:output = []
for l:line in a:lines
@@ -26,10 +26,13 @@ function! ale_linters#vala#vala_lint#Handle(buffer, lines) abort
continue
endif
+ let l:refined_type = l:match[3] is# 'warn' ? 'W' : 'E'
+ let l:cleaned_text = substitute(l:match[4], '^\s*\(.\{-}\)\s*$', '\1', '')
+
let l:lnum = l:match[1] + 0
let l:column = l:match[2] + 0
- let l:type = 'E'
- let l:text = substitute(l:match[4], '^\s*\(.\{-}\)\s*$', '\1', '')
+ let l:type = l:refined_type
+ let l:text = l:cleaned_text
let l:code = l:match[5]
call add(l:output, {