summaryrefslogtreecommitdiff
path: root/ale_linters/python/flake8.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/python/flake8.vim')
-rw-r--r--ale_linters/python/flake8.vim15
1 files changed, 5 insertions, 10 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index b5b5f3cc..076bd9c4 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -74,15 +74,11 @@ let s:end_col_pattern_map = {
\}
function! ale_linters#python#flake8#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:
"
@@ -90,7 +86,6 @@ function! ale_linters#python#flake8#Handle(buffer, lines) abort
"
" stdin:6:6: E111 indentation is not a multiple of four
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):?(\d+)?: ([[:alnum:]]+):? (.*)$'
- let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:code = l:match[3]