Fix #518 Fix handling of spaces in filenames for various linters

This commit is contained in:
w0rp 2017-04-29 17:33:18 +01:00
parent cbb01e32b9
commit 0b4acd6453
10 changed files with 200 additions and 48 deletions

View file

@ -15,8 +15,6 @@ function! ale_linters#python#mypy#GetCommand(buffer) abort
\ . ' %t'
endfunction
let s:path_pattern = '[a-zA-Z]\?\\\?:\?[[:alnum:]/\.\-_]\+'
function! ale_linters#python#mypy#Handle(buffer, lines) abort
" Look for lines like the following:
"
@ -25,7 +23,7 @@ function! 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 = '^' . s:path_pattern . ':\(\d\+\):\?\(\d\+\)\?: \([^:]\+\): \(.\+\)$'
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):?(\d+)?: ([^:]+): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)