summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-14 16:40:03 +0100
committerw0rp <devw0rp@gmail.com>2017-06-14 16:40:03 +0100
commit07af1799b1ea43e7fc83374b544bc069a2d306c5 (patch)
tree9a1a5bbb8c7c1aa09f1ba28a3dd6344695d93015 /ale_linters
parentf6b0a28cbacba36954cec02bffaee9f126610d69 (diff)
downloadale-07af1799b1ea43e7fc83374b544bc069a2d306c5.zip
#430 Use the style sub_type for flake8 problems
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/python/flake8.vim12
1 files changed, 10 insertions, 2 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index 7af02d4e..df091053 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -117,7 +117,6 @@ function! ale_linters#python#flake8#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" stdin:6:6: E111 indentation is not a multiple of four
- " test.yml:35: [EANSIBLE0002] Trailing whitespace
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):?(\d+)?: ([[:alnum:]]+) (.*)$'
let l:output = []
@@ -134,9 +133,18 @@ function! ale_linters#python#flake8#Handle(buffer, lines) abort
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:code . ': ' . l:match[4],
- \ 'type': l:code[:0] ==# 'E' ? 'E' : 'W',
+ \ 'type': 'W',
\}
+ if l:code[:0] ==# 'F'
+ let l:item.type = 'E'
+ elseif l:code[:0] ==# 'E'
+ let l:item.type = 'E'
+ let l:item.sub_type = 'style'
+ elseif l:code[:0] ==# 'W'
+ let l:item.sub_type = 'style'
+ endif
+
let l:end_col_pattern = get(s:end_col_pattern_map, l:code, '')
if !empty(l:end_col_pattern)