summaryrefslogtreecommitdiff
path: root/ale_linters/mercury
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/mercury
parent9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff)
downloadale-217284360d35711b751859ed27a7a3c3da300e85.zip
Simplify the code for most linters and tests with closures
Diffstat (limited to 'ale_linters/mercury')
-rw-r--r--ale_linters/mercury/mmc.vim9
1 files changed, 2 insertions, 7 deletions
diff --git a/ale_linters/mercury/mmc.vim b/ale_linters/mercury/mmc.vim
index c7bfc59d..76d357f0 100644
--- a/ale_linters/mercury/mmc.vim
+++ b/ale_linters/mercury/mmc.vim
@@ -4,16 +4,11 @@
call ale#Set('mercury_mmc_executable', 'mmc')
call ale#Set('mercury_mmc_options', '--make --output-compile-error-lines 100')
-function! ale_linters#mercury#mmc#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'mercury_mmc_executable')
-endfunction
-
function! ale_linters#mercury#mmc#GetCommand(buffer) abort
let l:module_name = expand('#' . a:buffer . ':t:r')
return ale#path#BufferCdString(a:buffer)
- \ . ale_linters#mercury#mmc#GetExecutable(a:buffer)
- \ . ' --errorcheck-only '
+ \ . '%e --errorcheck-only '
\ . ale#Var(a:buffer, 'mercury_mmc_options')
\ . ' ' . l:module_name
endfunction
@@ -38,7 +33,7 @@ endfunction
call ale#linter#Define('mercury', {
\ 'name': 'mmc',
\ 'output_stream': 'stderr',
-\ 'executable_callback': 'ale_linters#mercury#mmc#GetExecutable',
+\ 'executable_callback': ale#VarFunc('mercury_mmc_executable'),
\ 'command_callback': 'ale_linters#mercury#mmc#GetCommand',
\ 'callback': 'ale_linters#mercury#mmc#Handle',
\ 'lint_file': 1,