mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 13:14:29 +08:00
#427 Implement buffer variable overrides for all linter options
This commit is contained in:
@@ -4,12 +4,16 @@
|
||||
" Set this option to change the cppcheck options
|
||||
let g:ale_cpp_cppcheck_options = get(g:, 'ale_cpp_cppcheck_options', '--enable=style')
|
||||
|
||||
function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
||||
return 'cppcheck -q --language=c++ '
|
||||
\ . ale#Var(a:buffer, 'cpp_cppcheck_options')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'cppcheck',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable': 'cppcheck',
|
||||
\ 'command': 'cppcheck -q --language=c++ '
|
||||
\ . g:ale_cpp_cppcheck_options
|
||||
\ . ' %t',
|
||||
\ 'command_callback': 'ale_linters#cpp#cppcheck#GetCommand',
|
||||
\ 'callback': 'ale#handlers#HandleCppCheckFormat',
|
||||
\})
|
||||
|
||||
Reference in New Issue
Block a user