Fix #694 - Ignore BEGIN failed errors for Perl only for certain errors
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user