summaryrefslogtreecommitdiff
path: root/ale_linters/cpp/cppcheck.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/cpp/cppcheck.vim')
-rw-r--r--ale_linters/cpp/cppcheck.vim9
1 files changed, 4 insertions, 5 deletions
diff --git a/ale_linters/cpp/cppcheck.vim b/ale_linters/cpp/cppcheck.vim
index 9576b092..b2877158 100644
--- a/ale_linters/cpp/cppcheck.vim
+++ b/ale_linters/cpp/cppcheck.vim
@@ -2,15 +2,14 @@
" Description: cppcheck linter for cpp files
" Set this option to change the cppcheck options
-if !exists('g:ale_cpp_cppcheck_options')
- let g:ale_cpp_cppcheck_options = '--enable=style'
-endif
+let g:ale_cpp_cppcheck_options = get(g:, 'ale_cpp_cppcheck_options', '--enable=style')
call ale#linter#Define('cpp', {
\ 'name': 'cppcheck',
\ 'output_stream': 'both',
\ 'executable': 'cppcheck',
-\ 'command': g:ale#util#stdin_wrapper . ' .cpp cppcheck -q --language=c++ '
-\ . g:ale_cpp_cppcheck_options,
+\ 'command': 'cppcheck -q --language=c++ '
+\ . g:ale_cpp_cppcheck_options
+\ . ' %t',
\ 'callback': 'ale#handlers#HandleCppCheckFormat',
\})