summaryrefslogtreecommitdiff
path: root/ale_linters/cpp/cppcheck.vim
diff options
context:
space:
mode:
authorBart Libert <lapino@gmail.com>2016-10-20 13:30:45 +0200
committerw0rp <w0rp@users.noreply.github.com>2016-10-20 12:30:45 +0100
commita34fb0a6a7f920cd4d9a3e50facf51f8d5defea2 (patch)
tree74b97ad98e528be7df75259275ada10451769b12 /ale_linters/cpp/cppcheck.vim
parentacb209aa11960211718b7cb9b55688e5be1adc63 (diff)
downloadale-a34fb0a6a7f920cd4d9a3e50facf51f8d5defea2.zip
Add support for cppcheck (#126)
* Add support for cppcheck * Fix vint error in cppcheck handler * Add vader test for CppCheck format handler
Diffstat (limited to 'ale_linters/cpp/cppcheck.vim')
-rw-r--r--ale_linters/cpp/cppcheck.vim22
1 files changed, 22 insertions, 0 deletions
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 <bart.libert@gmail.com>
+" 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',
+\})