diff options
author | w0rp <w0rp@users.noreply.github.com> | 2017-10-12 22:06:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-12 22:06:48 +0100 |
commit | dded246aba9c054e4b91748cd4269c6cda2a03df (patch) | |
tree | cea5d05b9b8e95de51c1e0e7efdf4809e09f1f30 /test | |
parent | 3ddbe48d843b4082b5079925c063d75fa3d18d88 (diff) | |
parent | 221cb0f8cfbb27c9e2ecb58d01e059fdcfab7f34 (diff) | |
download | ale-dded246aba9c054e4b91748cd4269c6cda2a03df.zip |
Merge pull request #968 from adriaanzon/luacheck-whitespace
Luacheck: Respect warn_about_trailing_whitespace option
Diffstat (limited to 'test')
-rw-r--r-- | test/handler/test_lua_handler.vader | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/handler/test_lua_handler.vader b/test/handler/test_lua_handler.vader index af1c134e..712c7c59 100644 --- a/test/handler/test_lua_handler.vader +++ b/test/handler/test_lua_handler.vader @@ -1,4 +1,8 @@ +Before: + Save g:ale_warn_about_trailing_whitespace + After: + Restore call ale#linter#Reset() Execute(The luacheck handler should parse lines correctly): @@ -30,3 +34,25 @@ Execute(The luacheck handler should parse lines correctly): \ ' /file/path/here.lua:3:5: (W213) unused loop variable ''k''', \ ' /file/path/here.lua:3:19: (W113) accessing undefined variable ''x''', \ ]) + +Execute(The luacheck handler should respect the warn_about_trailing_whitespace option): + runtime ale_linters/lua/luacheck.vim + + let g:ale_warn_about_trailing_whitespace = 0 + + AssertEqual + \ [ + \ { + \ 'lnum': 5, + \ 'col': 43, + \ 'text': 'W212: unused argument ''g''', + \ 'type': 'W', + \ } + \ ], + \ ale_linters#lua#luacheck#Handle(347, [ + \ '/file/path/here.lua:15:97: (W614) trailing whitespace in a comment', + \ '/file/path/here.lua:16:60: (W612) line contains trailing whitespace', + \ '/file/path/here.lua:17:1: (W611) line contains only whitespace', + \ '/file/path/here.lua:27:57: (W613) trailing whitespace in a string', + \ '/file/path/here.lua:5:43: (W212) unused argument ''g''', + \ ]) |