summaryrefslogtreecommitdiff
path: root/ale_linters/c/clangtidy.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/c/clangtidy.vim')
-rw-r--r--ale_linters/c/clangtidy.vim8
1 files changed, 2 insertions, 6 deletions
diff --git a/ale_linters/c/clangtidy.vim b/ale_linters/c/clangtidy.vim
index d456a5a2..84c103e6 100644
--- a/ale_linters/c/clangtidy.vim
+++ b/ale_linters/c/clangtidy.vim
@@ -16,10 +16,6 @@ call ale#Set('c_clangtidy_checks', ['*'])
call ale#Set('c_clangtidy_options', '')
call ale#Set('c_build_dir', '')
-function! ale_linters#c#clangtidy#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'c_clangtidy_executable')
-endfunction
-
function! s:GetBuildDirectory(buffer) abort
" Don't include build directory for header files, as compile_commands.json
" files don't consider headers to be translation units, and provide no
@@ -47,7 +43,7 @@ function! ale_linters#c#clangtidy#GetCommand(buffer) abort
\ ? ale#Var(a:buffer, 'c_clangtidy_options')
\ : ''
- return ale#Escape(ale_linters#c#clangtidy#GetExecutable(a:buffer))
+ return '%e'
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
\ . ' %s'
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
@@ -57,7 +53,7 @@ endfunction
call ale#linter#Define('c', {
\ 'name': 'clangtidy',
\ 'output_stream': 'stdout',
-\ 'executable_callback': 'ale_linters#c#clangtidy#GetExecutable',
+\ 'executable_callback': ale#VarFunc('c_clangtidy_executable'),
\ 'command_callback': 'ale_linters#c#clangtidy#GetCommand',
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\ 'lint_file': 1,