Massively reduce the amount of code needed for linter tests

This commit is contained in:
w0rp
2018-07-15 18:24:53 +01:00
parent 5155a35a80
commit a42999a639
138 changed files with 1447 additions and 3017 deletions
+4 -6
View File
@@ -20,14 +20,12 @@ function! ale_linters#thrift#thrift#GetCommand(buffer) abort
let l:generators = ['cpp']
endif
let l:output_dir = ale#util#Tempname()
call mkdir(l:output_dir)
call ale#engine#ManageDirectory(a:buffer, l:output_dir)
let l:output_dir = ale#engine#CreateDirectory(a:buffer)
return ale#Escape(ale_linters#thrift#thrift#GetExecutable(a:buffer))
\ . ' ' . join(map(copy(l:generators), "'--gen ' . v:val"))
\ . ' ' . join(map(copy(l:includes), "'-I ' . v:val"))
\ . ' ' . ale#Var(a:buffer, 'thrift_thrift_options')
\ . 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'))
\ . ' -out ' . ale#Escape(l:output_dir)
\ . ' %t'
endfunction