summaryrefslogtreecommitdiff
path: root/ale_linters/matlab/mlint.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-08-02 23:44:12 +0100
committerw0rp <devw0rp@gmail.com>2018-08-02 23:44:12 +0100
commit217284360d35711b751859ed27a7a3c3da300e85 (patch)
tree4b26a84b397e3ac15a8b13a572b1f9a50312dbab /ale_linters/matlab/mlint.vim
parent9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff)
downloadale-217284360d35711b751859ed27a7a3c3da300e85.zip
Simplify the code for most linters and tests with closures
Diffstat (limited to 'ale_linters/matlab/mlint.vim')
-rw-r--r--ale_linters/matlab/mlint.vim17
1 files changed, 3 insertions, 14 deletions
diff --git a/ale_linters/matlab/mlint.vim b/ale_linters/matlab/mlint.vim
index 32766334..3435045e 100644
--- a/ale_linters/matlab/mlint.vim
+++ b/ale_linters/matlab/mlint.vim
@@ -1,18 +1,7 @@
" Author: awlayton <alex@layton.in>
" Description: mlint for MATLAB files
-let g:ale_matlab_mlint_executable =
-\ get(g:, 'ale_matlab_mlint_executable', 'mlint')
-
-function! ale_linters#matlab#mlint#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'matlab_mlint_executable')
-endfunction
-
-function! ale_linters#matlab#mlint#GetCommand(buffer) abort
- let l:executable = ale_linters#matlab#mlint#GetExecutable(a:buffer)
-
- return l:executable . ' -id %t'
-endfunction
+call ale#Set('matlab_mlint_executable', 'mlint')
function! ale_linters#matlab#mlint#Handle(buffer, lines) abort
" Matches patterns like the following:
@@ -48,8 +37,8 @@ endfunction
call ale#linter#Define('matlab', {
\ 'name': 'mlint',
-\ 'executable_callback': 'ale_linters#matlab#mlint#GetExecutable',
-\ 'command_callback': 'ale_linters#matlab#mlint#GetCommand',
+\ 'executable_callback': ale#VarFunc('matlab_mlint_executable'),
+\ 'command': '%e -id %t',
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#matlab#mlint#Handle',
\})