Allow warnings about trailing blank lines to be hidden for flake8 and pycodestyle

This commit is contained in:
w0rp 2017-11-28 10:08:34 +00:00
parent 4e821e64c7
commit 0ab689db0a
6 changed files with 101 additions and 9 deletions

View file

@ -91,6 +91,12 @@ function! ale_linters#python#flake8#Handle(buffer, lines) abort
continue
endif
if l:code is# 'W391'
\&& !ale#Var(a:buffer, 'warn_about_trailing_blank_lines')
" Skip warnings for trailing blank lines if the option is off
continue
endif
let l:item = {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,

View file

@ -23,6 +23,12 @@ function! ale_linters#python#pycodestyle#Handle(buffer, lines) abort
" lines are formatted as follows:
" file.py:21:26: W291 trailing whitespace
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if l:match[4] is# 'W391'
\&& !ale#Var(a:buffer, 'warn_about_trailing_blank_lines')
" Skip warnings for trailing blank lines if the option is off
continue
endif
let l:item = {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,