summaryrefslogtreecommitdiff
path: root/ale_linters/c/cpplint.vim
blob: 4b997941f91ea37c68364612065711248de15fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" Author: Justin Huang <justin.y.huang@live.com>
" Description: cpplint for c files

call ale#Set('c_cpplint_executable', 'cpplint')
call ale#Set('c_cpplint_options', '')

function! ale_linters#c#cpplint#GetCommand(buffer) abort
    let l:options = ale#Var(a:buffer, 'c_cpplint_options')

    return '%e' . ale#Pad(l:options) . ' %s'
endfunction

call ale#linter#Define('c', {
\   'name': 'cpplint',
\   'output_stream': 'stderr',
\   'executable': {b -> ale#Var(b, 'c_cpplint_executable')},
\   'command': function('ale_linters#c#cpplint#GetCommand'),
\   'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
\   'lint_file': 1,
\})