mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
#476 Make F401 a warning and E112 a syntax error
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user