Support pylama for python (#2266)

* Add pylama for python
* Consolidate python traceback handling
This commit is contained in:
Kevin Locke
2019-02-08 21:44:34 +00:00
committed by w0rp
parent 422908a572
commit a24f0b4d5f
13 changed files with 577 additions and 22 deletions

View File

@@ -46,19 +46,14 @@ endfunction
function! ale_linters#python#vulture#Handle(buffer, lines) abort
for l:line in a:lines[:10]
if match(l:line, '^Traceback') >= 0
return [{
\ 'lnum': 1,
\ 'text': 'An exception was thrown. See :ALEDetail',
\ 'detail': join(a:lines, "\n"),
\}]
endif
endfor
let l:output = ale#python#HandleTraceback(a:lines, 10)
if !empty(l:output)
return l:output
endif
" Matches patterns line the following:
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+): (.*)$'
let l:output = []
let l:dir = s:GetDir(a:buffer)
for l:match in ale#util#GetMatches(a:lines, l:pattern)