summaryrefslogtreecommitdiff
path: root/ale_linters/lua/luacheck.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/lua/luacheck.vim')
-rw-r--r--ale_linters/lua/luacheck.vim16
1 files changed, 4 insertions, 12 deletions
diff --git a/ale_linters/lua/luacheck.vim b/ale_linters/lua/luacheck.vim
index 725153c6..669103b8 100644
--- a/ale_linters/lua/luacheck.vim
+++ b/ale_linters/lua/luacheck.vim
@@ -1,19 +1,11 @@
" Author: Sol Bekic https://github.com/s-ol
" Description: luacheck linter for lua files
-let g:ale_lua_luacheck_executable =
-\ get(g:, 'ale_lua_luacheck_executable', 'luacheck')
-
-let g:ale_lua_luacheck_options =
-\ get(g:, 'ale_lua_luacheck_options', '')
-
-function! ale_linters#lua#luacheck#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'lua_luacheck_executable')
-endfunction
+call ale#Set('lua_luacheck_executable', 'luacheck')
+call ale#Set('lua_luacheck_options', '')
function! ale_linters#lua#luacheck#GetCommand(buffer) abort
- return ale#Escape(ale_linters#lua#luacheck#GetExecutable(a:buffer))
- \ . ' ' . ale#Var(a:buffer, 'lua_luacheck_options')
+ return '%e' . ale#Pad(ale#Var(a:buffer, 'lua_luacheck_options'))
\ . ' --formatter plain --codes --filename %s -'
endfunction
@@ -46,7 +38,7 @@ endfunction
call ale#linter#Define('lua', {
\ 'name': 'luacheck',
-\ 'executable_callback': 'ale_linters#lua#luacheck#GetExecutable',
+\ 'executable_callback': ale#VarFunc('lua_luacheck_executable'),
\ 'command_callback': 'ale_linters#lua#luacheck#GetCommand',
\ 'callback': 'ale_linters#lua#luacheck#Handle',
\})