#427 Implement buffer variable overrides for all linter options

This commit is contained in:
w0rp 2017-04-16 01:24:08 +01:00
parent e80116cee0
commit e97dada261
45 changed files with 117 additions and 108 deletions

View file

@ -11,7 +11,7 @@ function! ale_linters#cpp#clang#GetCommand(buffer) abort
" headers in the same directory.
return 'clang++ -S -x c++ -fsyntax-only '
\ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ' ' . g:ale_cpp_clang_options . ' -'
\ . ' ' . ale#Var(a:buffer, 'cpp_clang_options') . ' -'
endfunction
call ale#linter#Define('cpp', {

View file

@ -6,7 +6,7 @@ let g:ale_cpp_clangtidy_options =
\ get(g:, 'ale_cpp_clangtidy_options', '-std=c++14 -Wall')
function! ale_linters#cpp#clangtidy#GetCommand(buffer) abort
return 'clang-tidy %t -- ' . g:ale_cpp_clangtidy_options
return 'clang-tidy %t -- ' . ale#Var(a:buffer, 'cpp_clangtidy_options')
endfunction
call ale#linter#Define('cpp', {

View file

@ -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',
\})

View file

@ -20,7 +20,7 @@ function! ale_linters#cpp#gcc#GetCommand(buffer) abort
" headers in the same directory.
return 'gcc -S -x c++ -fsyntax-only '
\ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ' ' . g:ale_cpp_gcc_options . ' -'
\ . ' ' . ale#Var(a:buffer, 'cpp_gcc_options') . ' -'
endfunction
call ale#linter#Define('cpp', {