aboutsummaryrefslogtreecommitdiff
path: root/.vim/autoload/neomake/makers/ft/cpp.vim
blob: 0cfa8774aa2ed0adeb3b203e6d67200a728c746f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
" vim: ts=4 sw=4 et

function! neomake#makers#ft#cpp#EnabledMakers() abort
    let makers = executable('clang++') ? ['clang', 'clangtidy', 'clangcheck'] : ['gcc']
    call add(makers, 'cppcheck')
    return makers
endfunction

function! neomake#makers#ft#cpp#clang() abort
    let maker = neomake#makers#ft#c#clang()
    let maker.exe = 'clang++'
    let maker.args += ['-std=c++1z']
    return maker
endfunction

function! neomake#makers#ft#cpp#gcc() abort
    let maker = neomake#makers#ft#c#gcc()
    let maker.exe = 'g++'
    let maker.args += ['-std=c++1z']
    return maker
endfunction

function! neomake#makers#ft#cpp#clangtidy() abort
    return neomake#makers#ft#c#clangtidy()
endfunction

function! neomake#makers#ft#cpp#clangcheck() abort
    return neomake#makers#ft#c#clangcheck()
endfunction

function! neomake#makers#ft#cpp#cppcheck() abort
    let maker = neomake#makers#ft#c#cppcheck()
    let maker.args[0] = '--language=c++'
    return maker
endfunction

function! neomake#makers#ft#cpp#cpplint() abort
    return {
        \ 'exe': executable('cpplint') ? 'cpplint' : 'cpplint.py',
        \ 'args': ['--verbose=3'],
        \ 'errorformat':
        \     '%A%f:%l:  %m [%t],' .
        \     '%-G%.%#',
        \ 'postprocess': function('neomake#makers#ft#cpp#CpplintEntryProcess')
        \ }
endfunction

function! neomake#makers#ft#cpp#CpplintEntryProcess(entry) abort
    let a:entry.type = str2nr(a:entry.type) < 5 ? 'W' : 'E'
endfunction