diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-19 00:02:35 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-19 00:02:35 +0000 |
commit | 40e26f0bc2a00d25defe190bc277a0cf6ea71479 (patch) | |
tree | 496ae3b7be63d46f15c376775fdc5b73b27686d5 | |
parent | 41cb174f3aeaa38e3d558a197a194c0161fa5b66 (diff) | |
download | ale-40e26f0bc2a00d25defe190bc277a0cf6ea71479.zip |
#852 - Capture error codes for luacheck
-rw-r--r-- | ale_linters/lua/luacheck.vim | 3 | ||||
-rw-r--r-- | test/handler/test_lua_handler.vader | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/ale_linters/lua/luacheck.vim b/ale_linters/lua/luacheck.vim index 9f9ca4c4..725153c6 100644 --- a/ale_linters/lua/luacheck.vim +++ b/ale_linters/lua/luacheck.vim @@ -35,8 +35,9 @@ function! ale_linters#lua#luacheck#Handle(buffer, lines) abort call add(l:output, { \ 'lnum': l:match[1] + 0, \ 'col': l:match[2] + 0, - \ 'text': l:match[3] . l:match[4] . ': ' . l:match[5], \ 'type': l:match[3], + \ 'code': l:match[3] . l:match[4], + \ 'text': l:match[5], \}) endfor diff --git a/test/handler/test_lua_handler.vader b/test/handler/test_lua_handler.vader index 035dac24..7cebb017 100644 --- a/test/handler/test_lua_handler.vader +++ b/test/handler/test_lua_handler.vader @@ -1,6 +1,8 @@ Before: Save g:ale_warn_about_trailing_whitespace + let g:ale_warn_about_trailing_whitespace = 1 + runtime ale_linters/lua/luacheck.vim After: @@ -13,19 +15,22 @@ Execute(The luacheck handler should parse lines correctly): \ { \ 'lnum': 1, \ 'col': 8, - \ 'text': 'W612: line contains trailing whitespace', + \ 'text': 'line contains trailing whitespace', + \ 'code': 'W612', \ 'type': 'W', \ }, \ { \ 'lnum': 3, \ 'col': 5, - \ 'text': 'W213: unused loop variable ''k''', + \ 'text': 'unused loop variable ''k''', + \ 'code': 'W213', \ 'type': 'W', \ }, \ { \ 'lnum': 3, \ 'col': 19, - \ 'text': 'W113: accessing undefined variable ''x''', + \ 'text': 'accessing undefined variable ''x''', + \ 'code': 'W113', \ 'type': 'W', \ }, \ ], @@ -43,7 +48,8 @@ Execute(The luacheck handler should respect the warn_about_trailing_whitespace o \ { \ 'lnum': 5, \ 'col': 43, - \ 'text': 'W212: unused argument ''g''', + \ 'text': 'unused argument ''g''', + \ 'code': 'W212', \ 'type': 'W', \ } \ ], |