Merge pull request #1563 from IngoHeimbach/fix/gcc-fatal-error

Fatal GCC errors are handled as errors not warnings
This commit is contained in:
w0rp 2018-05-09 09:14:38 +01:00 committed by GitHub
commit 38c66d33fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -48,7 +48,7 @@ function! ale#handlers#gcc#HandleGCCFormat(buffer, lines) abort
let l:item = {
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:match[4] is# 'error' ? 'E' : 'W',
\ 'type': (l:match[4] is# 'error' || l:match[4] is# 'fatal error') ? 'E' : 'W',
\ 'text': s:RemoveUnicodeQuotes(l:match[5]),
\}

View File

@ -148,3 +148,17 @@ Execute(The GCC handler should interpret - as being the current file):
\ ale#handlers#gcc#HandleGCCFormat(347, [
\ '-:6:12: error: Some error',
\ ])
Execute(The GCC handler should handle fatal error messages due to missing files):
AssertEqual
\ [
\ {
\ 'lnum': 3,
\ 'col': 12,
\ 'type': 'E',
\ 'text': 'foo.h: No such file or directory'
\ },
\ ],
\ ale#handlers#gcc#HandleGCCFormat(347, [
\ '<stdin>:3:12: fatal error: foo.h: No such file or directory',
\ ])