Add an option disabling warnings about trailing whitespace, and use it in flake8.

This commit is contained in:
w0rp 2016-09-15 13:08:21 +01:00
parent b236b6b353
commit c4fb7f949d
2 changed files with 10 additions and 0 deletions

View File

@ -24,6 +24,11 @@ function! ale_linters#python#flake8#Handle(buffer, lines)
let text = l:match[4] let text = l:match[4]
let type = code[0] ==# 'E' ? 'E' : 'W' let type = code[0] ==# 'E' ? 'E' : 'W'
if code ==# 'W291' && !g:ale_warn_about_trailing_whitespace
" Skip warnings for trailing whitespace if the option is off.
continue
endif
" vcol is Needed to indicate that the column is a character. " vcol is Needed to indicate that the column is a character.
call add(output, { call add(output, {
\ 'bufnr': a:buffer, \ 'bufnr': a:buffer,

View File

@ -40,3 +40,8 @@ endif
if !exists('g:ale_echo_cursor') if !exists('g:ale_echo_cursor')
let g:ale_echo_cursor = 1 let g:ale_echo_cursor = 1
endif endif
" This flag can be set to 0 to disable warnings for trailing whitespace
if !exists('g:ale_warn_about_trailing_whitespace')
let g:ale_warn_about_trailing_whitespace = 1
endif