summaryrefslogtreecommitdiff
path: root/ale_linters/matlab
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-02-11 19:40:57 +0000
committerw0rp <devw0rp@gmail.com>2017-02-11 19:40:57 +0000
commitecbb27680563a50d4dd981f968d659ef20bfbe30 (patch)
tree3e60f1ad7840dce1351819cd191a4c7ca0a7330e /ale_linters/matlab
parentc33602534e205aa677521ce49a8054588d88bdc2 (diff)
downloadale-ecbb27680563a50d4dd981f968d659ef20bfbe30.zip
Replace every stdin-wrapper script with the new %t formatting support
Diffstat (limited to 'ale_linters/matlab')
-rw-r--r--ale_linters/matlab/mlint.vim15
1 files changed, 12 insertions, 3 deletions
diff --git a/ale_linters/matlab/mlint.vim b/ale_linters/matlab/mlint.vim
index 302e75ce..8eb747ec 100644
--- a/ale_linters/matlab/mlint.vim
+++ b/ale_linters/matlab/mlint.vim
@@ -4,6 +4,16 @@
let g:ale_matlab_mlint_executable =
\ get(g:, 'ale_matlab_mlint_executable', 'mlint')
+function! ale_linters#matlab#mlint#GetExecutable(buffer) abort
+ return g:ale_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
+
function! ale_linters#matlab#mlint#Handle(buffer, lines) abort
" Matches patterns like the following:
"
@@ -47,9 +57,8 @@ endfunction
call ale#linter#Define('matlab', {
\ 'name': 'mlint',
-\ 'executable': 'mlint',
-\ 'command': g:ale#util#stdin_wrapper .
-\ ' .m ' . g:ale_matlab_mlint_executable . ' -id',
+\ 'executable_callback': 'ale_linters#matlab#mlint#GetExecutable',
+\ 'command_callback': 'ale_linters#matlab#mlint#GetCommand',
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#matlab#mlint#Handle',
\})