summaryrefslogtreecommitdiff
path: root/ale_linters/cpp/clangtidy.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-02-11 23:45:06 +0000
committerw0rp <devw0rp@gmail.com>2017-02-11 23:45:06 +0000
commited269b88317b348baaa86efd7d51324fda35d254 (patch)
tree1d09b56ca0696bb3f44a4b63c30040792f11e2db /ale_linters/cpp/clangtidy.vim
parent355608b031d98b8f0adbc5d210ee0a8e2e9b1a88 (diff)
downloadale-ed269b88317b348baaa86efd7d51324fda35d254.zip
Fix the clangtidy linter, and document everything
Diffstat (limited to 'ale_linters/cpp/clangtidy.vim')
-rw-r--r--ale_linters/cpp/clangtidy.vim13
1 files changed, 8 insertions, 5 deletions
diff --git a/ale_linters/cpp/clangtidy.vim b/ale_linters/cpp/clangtidy.vim
index ef7c63e8..11088c43 100644
--- a/ale_linters/cpp/clangtidy.vim
+++ b/ale_linters/cpp/clangtidy.vim
@@ -1,15 +1,18 @@
-" Author: vdeurzen <tim@kompiler.org>
+" Author: vdeurzen <tim@kompiler.org>, w0rp <devw0rp@gmail.com>
" 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
+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
+endfunction
call ale#linter#Define('cpp', {
\ 'name': 'clangtidy',
\ 'output_stream': 'stdout',
\ 'executable': 'clang-tidy',
-\ 'command': g:ale#util#stdin_wrapper . ' -- ' . g:ale_cpp_clangtidy_options,
+\ 'command_callback': 'ale_linters#cpp#clangtidy#GetCommand',
\ 'callback': 'ale#handlers#HandleGCCFormat',
\})