summaryrefslogtreecommitdiff
path: root/ale_linters/cuda/nvcc.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/cuda/nvcc.vim
parent9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff)
downloadale-217284360d35711b751859ed27a7a3c3da300e85.zip
Simplify the code for most linters and tests with closures
Diffstat (limited to 'ale_linters/cuda/nvcc.vim')
-rw-r--r--ale_linters/cuda/nvcc.vim15
1 files changed, 5 insertions, 10 deletions
diff --git a/ale_linters/cuda/nvcc.vim b/ale_linters/cuda/nvcc.vim
index 3764fe9d..a3678910 100644
--- a/ale_linters/cuda/nvcc.vim
+++ b/ale_linters/cuda/nvcc.vim
@@ -4,20 +4,15 @@
call ale#Set('cuda_nvcc_executable', 'nvcc')
call ale#Set('cuda_nvcc_options', '-std=c++11')
-function! ale_linters#cuda#nvcc#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'cuda_nvcc_executable')
-endfunction
-
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
" Unused: use ale#util#nul_file
" let l:output_file = ale#util#Tempname() . '.ii'
" call ale#engine#ManageFile(a:buffer, l:output_file)
- return ale#Escape(ale_linters#cuda#nvcc#GetExecutable(a:buffer))
- \ . ' -cuda '
- \ . ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer))
- \ . ale#Var(a:buffer, 'cuda_nvcc_options') . ' %s'
- \ . ' -o ' . g:ale#util#nul_file
+ return '%e -cuda'
+ \ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
+ \ . ale#Pad(ale#Var(a:buffer, 'cuda_nvcc_options'))
+ \ . ' %s -o ' . g:ale#util#nul_file
endfunction
function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
@@ -49,7 +44,7 @@ endfunction
call ale#linter#Define('cuda', {
\ 'name': 'nvcc',
\ 'output_stream': 'stderr',
-\ 'executable_callback': 'ale_linters#cuda#nvcc#GetExecutable',
+\ 'executable_callback': ale#VarFunc('cuda_nvcc_executable'),
\ 'command_callback': 'ale_linters#cuda#nvcc#GetCommand',
\ 'callback': 'ale_linters#cuda#nvcc#HandleNVCCFormat',
\ 'lint_file': 1,