summaryrefslogtreecommitdiff
path: root/ale_linters/cpp/clangtidy.vim
blob: 2acd345a674d81e8b21b7995aad612439054ab28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
" 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.
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 -- ' . ale#Var(a:buffer, 'cpp_clangtidy_options')
endfunction

call ale#linter#Define('cpp', {
\   'name': 'clangtidy',
\   'output_stream': 'stdout',
\   'executable': 'clang-tidy',
\   'command_callback': 'ale_linters#cpp#clangtidy#GetCommand',
\   'callback': 'ale#handlers#gcc#HandleGCCFormat',
\})