From a34fb0a6a7f920cd4d9a3e50facf51f8d5defea2 Mon Sep 17 00:00:00 2001 From: Bart Libert Date: Thu, 20 Oct 2016 13:30:45 +0200 Subject: Add support for cppcheck (#126) * Add support for cppcheck * Fix vint error in cppcheck handler * Add vader test for CppCheck format handler --- ale_linters/c/cppcheck.vim | 22 ++++++++++++++++++++++ ale_linters/cpp/cppcheck.vim | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 ale_linters/c/cppcheck.vim create mode 100644 ale_linters/cpp/cppcheck.vim (limited to 'ale_linters') diff --git a/ale_linters/c/cppcheck.vim b/ale_linters/c/cppcheck.vim new file mode 100644 index 00000000..891b4ffb --- /dev/null +++ b/ale_linters/c/cppcheck.vim @@ -0,0 +1,22 @@ +" Author: Bart Libert +" Description: cppcheck linter for c files + +if exists('g:loaded_ale_linters_c_cppcheck') + finish +endif + +let g:loaded_ale_linters_c_cppcheck = 1 + +" Set this option to change the cppcheck options +if !exists('g:ale_c_cppcheck_options') + let g:ale_c_cppcheck_options = '--enable=style' +endif + +call ale#linter#Define('c', { +\ 'name': 'cppcheck', +\ 'output_stream': 'both', +\ 'executable': 'cppcheck', +\ 'command': g:ale#util#stdin_wrapper . ' .c cppcheck -q --language=c ' +\ . g:ale_c_cppcheck_options, +\ 'callback': 'ale#handlers#HandleCppCheckFormat', +\}) diff --git a/ale_linters/cpp/cppcheck.vim b/ale_linters/cpp/cppcheck.vim new file mode 100644 index 00000000..d8057901 --- /dev/null +++ b/ale_linters/cpp/cppcheck.vim @@ -0,0 +1,22 @@ +" Author: Bart Libert +" Description: cppcheck linter for cpp files + +if exists('g:loaded_ale_linters_cpp_cppcheck') + finish +endif + +let g:loaded_ale_linters_cpp_cppcheck = 1 + +" Set this option to change the cppcheck options +if !exists('g:ale_cpp_cppcheck_options') + let g:ale_cpp_cppcheck_options = '--enable=style' +endif + +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, +\ 'callback': 'ale#handlers#HandleCppCheckFormat', +\}) -- cgit v1.2.3