#703 Add arguments to avoid generating plist files if no build directory is detected for clang-check
This commit is contained in:
parent
3b1bc2bd13
commit
eab77b7072
@ -19,10 +19,14 @@ function! ale_linters#cpp#clangcheck#GetCommand(buffer) abort
|
|||||||
let l:build_dir = ale#c#FindCompileCommands(a:buffer)
|
let l:build_dir = ale#c#FindCompileCommands(a:buffer)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" The extra arguments in the command are used to prevent .plist files from
|
||||||
|
" being generated. These are only added if no build directory can be
|
||||||
|
" detected.
|
||||||
return ale#Escape(ale_linters#cpp#clangcheck#GetExecutable(a:buffer))
|
return ale#Escape(ale_linters#cpp#clangcheck#GetExecutable(a:buffer))
|
||||||
\ . ' -analyze %s'
|
\ . ' -analyze %s'
|
||||||
\ . (!empty(l:user_options) ? ' ' . l:user_options : '')
|
\ . (!empty(l:user_options) ? ' ' . l:user_options : '')
|
||||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
|
\ . (empty(l:build_dir) ? ' -extra-arg -Xanalyzer -extra-arg -analyzer-output=text' : '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
|
@ -26,20 +26,28 @@ Execute(The executable should be configurable):
|
|||||||
|
|
||||||
Execute(The executable should be used in the command):
|
Execute(The executable should be used in the command):
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ ale#Escape('clang-check') . ' -analyze %s',
|
\ ale#Escape('clang-check')
|
||||||
|
\ . ' -analyze %s'
|
||||||
|
\ . ' -extra-arg -Xanalyzer -extra-arg -analyzer-output=text',
|
||||||
\ ale_linters#cpp#clangcheck#GetCommand(bufnr(''))
|
\ ale_linters#cpp#clangcheck#GetCommand(bufnr(''))
|
||||||
|
|
||||||
let b:ale_cpp_clangcheck_executable = 'foobar'
|
let b:ale_cpp_clangcheck_executable = 'foobar'
|
||||||
|
|
||||||
|
" The extra arguments in the command are used to prevent .plist files from
|
||||||
|
" being generated.
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ ale#Escape('foobar') . ' -analyze %s',
|
\ ale#Escape('foobar')
|
||||||
|
\ . ' -analyze %s'
|
||||||
|
\ . ' -extra-arg -Xanalyzer -extra-arg -analyzer-output=text',
|
||||||
\ ale_linters#cpp#clangcheck#GetCommand(bufnr(''))
|
\ ale_linters#cpp#clangcheck#GetCommand(bufnr(''))
|
||||||
|
|
||||||
Execute(The options should be configurable):
|
Execute(The options should be configurable):
|
||||||
let b:ale_cpp_clangcheck_options = '--something'
|
let b:ale_cpp_clangcheck_options = '--something'
|
||||||
|
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ ale#Escape('clang-check') . ' -analyze %s --something',
|
\ ale#Escape('clang-check')
|
||||||
|
\ . ' -analyze %s --something'
|
||||||
|
\ . ' -extra-arg -Xanalyzer -extra-arg -analyzer-output=text',
|
||||||
\ ale_linters#cpp#clangcheck#GetCommand(bufnr(''))
|
\ ale_linters#cpp#clangcheck#GetCommand(bufnr(''))
|
||||||
|
|
||||||
Execute(The build directory should be used when set):
|
Execute(The build directory should be used when set):
|
||||||
|
Loading…
Reference in New Issue
Block a user