From ed269b88317b348baaa86efd7d51324fda35d254 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 11 Feb 2017 23:45:06 +0000 Subject: Fix the clangtidy linter, and document everything --- ale_linters/cpp/clangtidy.vim | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ale_linters/cpp') 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 +" Author: vdeurzen , w0rp " 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', \}) -- cgit v1.2.3