Fix mypy error parsing when column numbers are included.
This commit is contained in:
parent
829f87bc6a
commit
d953c68ebb
2 changed files with 13 additions and 1 deletions
|
@ -16,6 +16,8 @@ function! g:ale_linters#python#mypy#GetCommand(buffer) abort
|
|||
\ . g:ale_python_mypy_options
|
||||
endfunction
|
||||
|
||||
let s:path_pattern = '[a-zA-Z]\?\\\?:\?[[:alnum:]/\.\-_]\+'
|
||||
|
||||
function! g:ale_linters#python#mypy#Handle(buffer, lines) abort
|
||||
" Look for lines like the following:
|
||||
"
|
||||
|
@ -24,7 +26,7 @@ function! g:ale_linters#python#mypy#Handle(buffer, lines) abort
|
|||
" Lines like these should be ignored below:
|
||||
"
|
||||
" file.py:4: note: (Stub files are from https://github.com/python/typeshed)
|
||||
let l:pattern = '^.\+:\(\d\+\):\?\(\d\+\)\?: \([^:]\+\): \(.\+\)$'
|
||||
let l:pattern = '^' . s:path_pattern . ':\(\d\+\):\?\(\d\+\)\?: \([^:]\+\): \(.\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:line in a:lines
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue