Fix the clangtidy linter, and document everything

This commit is contained in:
w0rp
2017-02-11 23:45:06 +00:00
parent 355608b031
commit ed269b8831
3 changed files with 55 additions and 41 deletions

View File

@@ -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',
\})