summaryrefslogtreecommitdiff
path: root/ale_linters/thrift/thrift.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/thrift/thrift.vim
parent9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff)
downloadale-217284360d35711b751859ed27a7a3c3da300e85.zip
Simplify the code for most linters and tests with closures
Diffstat (limited to 'ale_linters/thrift/thrift.vim')
-rw-r--r--ale_linters/thrift/thrift.vim8
1 files changed, 2 insertions, 6 deletions
diff --git a/ale_linters/thrift/thrift.vim b/ale_linters/thrift/thrift.vim
index a8fe10b6..ac1f69fc 100644
--- a/ale_linters/thrift/thrift.vim
+++ b/ale_linters/thrift/thrift.vim
@@ -5,10 +5,6 @@ call ale#Set('thrift_thrift_generators', ['cpp'])
call ale#Set('thrift_thrift_includes', [])
call ale#Set('thrift_thrift_options', '-strict')
-function! ale_linters#thrift#thrift#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'thrift_thrift_executable')
-endfunction
-
function! ale_linters#thrift#thrift#GetCommand(buffer) abort
let l:generators = ale#Var(a:buffer, 'thrift_thrift_generators')
let l:includes = ale#Var(a:buffer, 'thrift_thrift_includes')
@@ -22,7 +18,7 @@ function! ale_linters#thrift#thrift#GetCommand(buffer) abort
let l:output_dir = ale#engine#CreateDirectory(a:buffer)
- return ale#Escape(ale_linters#thrift#thrift#GetExecutable(a:buffer))
+ return '%e'
\ . ale#Pad(join(map(copy(l:generators), "'--gen ' . v:val")))
\ . ale#Pad(join(map(copy(l:includes), "'-I ' . v:val")))
\ . ale#Pad(ale#Var(a:buffer, 'thrift_thrift_options'))
@@ -83,7 +79,7 @@ call ale#linter#Define('thrift', {
\ 'name': 'thrift',
\ 'executable': 'thrift',
\ 'output_stream': 'both',
-\ 'executable_callback': 'ale_linters#thrift#thrift#GetExecutable',
+\ 'executable_callback': ale#VarFunc('thrift_thrift_executable'),
\ 'command_callback': 'ale_linters#thrift#thrift#GetCommand',
\ 'callback': 'ale_linters#thrift#thrift#Handle',
\})