summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-02-18 09:44:04 +0000
committerw0rp <devw0rp@gmail.com>2018-02-18 09:44:04 +0000
commit5972b9722370e95f48382fc1d696d17a9fa30c85 (patch)
treec0d1391519782b7617568d1a95d803d8e242c41e /ale_linters
parentfcb7932d7d61cda142da7597c9df4da4847f0ca8 (diff)
downloadale-5972b9722370e95f48382fc1d696d17a9fa30c85.zip
#476 Make F401 a warning and E112 a syntax error
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/python/flake8.vim11
-rw-r--r--ale_linters/python/pycodestyle.vim4
2 files changed, 10 insertions, 5 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index 400e60f0..e7bbcfb1 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -105,11 +105,16 @@ function! ale_linters#python#flake8#Handle(buffer, lines) abort
\ 'type': 'W',
\}
- if l:code[:0] is# 'F' || l:code is# 'E999'
- let l:item.type = 'E'
+ if l:code[:0] is# 'F'
+ if l:code isnot# 'F401'
+ let l:item.type = 'E'
+ endif
elseif l:code[:0] is# 'E'
let l:item.type = 'E'
- let l:item.sub_type = 'style'
+
+ if l:code isnot# 'E999' && l:code isnot# 'E112'
+ let l:item.sub_type = 'style'
+ endif
elseif l:code[:0] is# 'W'
let l:item.sub_type = 'style'
endif
diff --git a/ale_linters/python/pycodestyle.vim b/ale_linters/python/pycodestyle.vim
index bbecdf03..19f05a53 100644
--- a/ale_linters/python/pycodestyle.vim
+++ b/ale_linters/python/pycodestyle.vim
@@ -44,8 +44,8 @@ function! ale_linters#python#pycodestyle#Handle(buffer, lines) abort
\ 'code': l:match[4],
\}
- " E999 is not a style error, it's a syntax error.
- if l:match[4] is# 'E999'
+ " E999 and E112 are syntax errors.
+ if l:match[4] is# 'E999' || l:match[4] is# 'E112'
unlet l:item.sub_type
endif