Luacheck: Respect warn_about_trailing_whitespace option

See http://luacheck.readthedocs.io/en/stable/warnings.html, warnings
611 to 614.
This commit is contained in:
Adriaan Zonnenberg 2017-09-30 16:38:10 +02:00
parent c989ef0fc6
commit 1d1b5155e6

View File

@ -26,6 +26,12 @@ function! ale_linters#lua#luacheck#Handle(buffer, lines) abort
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
\ && l:match[3] is# 'W'
\ && index(range(611, 614), str2nr(l:match[4])) >= 0
continue
endif
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,