summaryrefslogtreecommitdiff
path: root/ale_linters/lua
diff options
context:
space:
mode:
authorAdriaan Zonnenberg <amz@adriaan.xyz>2017-09-30 16:38:10 +0200
committerAdriaan Zonnenberg <amz@adriaan.xyz>2017-09-30 16:38:10 +0200
commit1d1b5155e63df93d2dc700989faec1c40d490d90 (patch)
tree6b2a8ffdf58e1fb2f8944089b41cf5168b66c17d /ale_linters/lua
parentc989ef0fc69c6bfb702fd91ff9ea08d0759db691 (diff)
downloadale-1d1b5155e63df93d2dc700989faec1c40d490d90.zip
Luacheck: Respect warn_about_trailing_whitespace option
See http://luacheck.readthedocs.io/en/stable/warnings.html, warnings 611 to 614.
Diffstat (limited to 'ale_linters/lua')
-rw-r--r--ale_linters/lua/luacheck.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/ale_linters/lua/luacheck.vim b/ale_linters/lua/luacheck.vim
index e15b7301..9f9ca4c4 100644
--- a/ale_linters/lua/luacheck.vim
+++ b/ale_linters/lua/luacheck.vim
@@ -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,