summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2019-01-27 10:57:42 +0000
committerGitHub <noreply@github.com>2019-01-27 10:57:42 +0000
commitd882c434a1c8f3814da51340a38fdcd5659e76bd (patch)
tree3d7f348a9c7d040b7c71afa2717d018878d0f1bf
parent3ac12b69399fc1f85e9a8ad2e76dc4e1f938f7d2 (diff)
parentcdc3bc9238d2aca4b6f30511071b59415e9b79f7 (diff)
downloadale-d882c434a1c8f3814da51340a38fdcd5659e76bd.zip
Merge pull request #2215 from irwand/master
support older flake8 output, still used by hacking module from openstack style guide
-rw-r--r--ale_linters/python/flake8.vim2
-rw-r--r--test/handler/test_flake8_handler.vader16
2 files changed, 17 insertions, 1 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index 14b67d77..b5b5f3cc 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -89,7 +89,7 @@ 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
- let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):?(\d+)?: ([[:alnum:]]+) (.*)$'
+ let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):?(\d+)?: ([[:alnum:]]+):? (.*)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
diff --git a/test/handler/test_flake8_handler.vader b/test/handler/test_flake8_handler.vader
index cdf20bc0..fe42211a 100644
--- a/test/handler/test_flake8_handler.vader
+++ b/test/handler/test_flake8_handler.vader
@@ -258,3 +258,19 @@ Execute(E112 should be a syntax error):
\ ale_linters#python#flake8#Handle(bufnr(''), [
\ 'foo.py:6:1: E112 expected an indented block',
\ ])
+
+Execute(Compatibility with hacking which uses older style flake8):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'H306',
+ \ 'type': 'W',
+ \ 'text': 'imports not in alphabetical order (smtplib, io)',
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(bufnr(''), [
+ \ 'foo.py:6:1: H306: imports not in alphabetical order (smtplib, io)',
+ \ ])