From 355608b031d98b8f0adbc5d210ee0a8e2e9b1a88 Mon Sep 17 00:00:00 2001 From: Tim van Deurzen Date: Sun, 12 Feb 2017 00:32:56 +0100 Subject: [PATCH] Add clang-tidy linter for cpp. (#275) * Add clang-tidy linter for cpp. * Use stdin-wrapper to allow linting as you type. --- ale_linters/cpp/clangtidy.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ale_linters/cpp/clangtidy.vim diff --git a/ale_linters/cpp/clangtidy.vim b/ale_linters/cpp/clangtidy.vim new file mode 100644 index 00000000..ef7c63e8 --- /dev/null +++ b/ale_linters/cpp/clangtidy.vim @@ -0,0 +1,15 @@ +" Author: vdeurzen +" Description: clang-tidy linter for cpp files + +" Set this option to change the clang-tidy options for warnings for C. +if !exists('g:ale_cpp_clangtidy_options') + let g:ale_cpp_clangtidy_options = '-std=c++14 -Wall' +endif + +call ale#linter#Define('cpp', { +\ 'name': 'clangtidy', +\ 'output_stream': 'stdout', +\ 'executable': 'clang-tidy', +\ 'command': g:ale#util#stdin_wrapper . ' -- ' . g:ale_cpp_clangtidy_options, +\ 'callback': 'ale#handlers#HandleGCCFormat', +\})