summaryrefslogtreecommitdiff
path: root/ale_linters/perl
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-25 21:49:57 +0100
committerw0rp <devw0rp@gmail.com>2017-06-25 21:49:57 +0100
commit1917e9157c5134044e16bb84997ad7fe5860a833 (patch)
tree72316f7a63cb34e7b2e3f3dc8836a5f0e51ef49c /ale_linters/perl
parent3828ea5b2655a03fe8de0332797386f42ae3b9ac (diff)
downloadale-1917e9157c5134044e16bb84997ad7fe5860a833.zip
Fix #694 - Ignore BEGIN failed errors for Perl only for certain errors
Diffstat (limited to 'ale_linters/perl')
-rw-r--r--ale_linters/perl/perl.vim11
1 files changed, 10 insertions, 1 deletions
diff --git a/ale_linters/perl/perl.vim b/ale_linters/perl/perl.vim
index f4b35ab9..087d03eb 100644
--- a/ale_linters/perl/perl.vim
+++ b/ale_linters/perl/perl.vim
@@ -17,6 +17,11 @@ function! ale_linters#perl#perl#GetCommand(buffer) abort
\ . ' %t'
endfunction
+let s:begin_failed_skip_pattern = '\v' . join([
+\ '^Compilation failed in require',
+\ '^Can''t locate',
+\], '|')
+
function! ale_linters#perl#perl#Handle(buffer, lines) abort
let l:pattern = '\(.\+\) at \(.\+\) line \(\d\+\)'
let l:output = []
@@ -28,7 +33,11 @@ function! ale_linters#perl#perl#Handle(buffer, lines) abort
let l:type = 'E'
if ale#path#IsBufferPath(a:buffer, l:match[2])
- \&& l:text !=# 'BEGIN failed--compilation aborted'
+ \ && (
+ \ l:text !=# 'BEGIN failed--compilation aborted'
+ \ || empty(l:output)
+ \ || match(l:output[-1].text, s:begin_failed_skip_pattern) < 0
+ \ )
call add(l:output, {
\ 'lnum': l:line,
\ 'text': l:text,