summaryrefslogtreecommitdiff
path: root/ale_linters/cmake/cmakelint.vim
blob: fb876c665ee9f58b850795d55142470c2a820211 (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
" Author: Kenneth Benzie <k.benzie83@gmail.com>
" Description: cmakelint for cmake files

let g:ale_cmake_cmakelint_executable =
\   get(g:, 'ale_cmake_cmakelint_executable', 'cmakelint')

let g:ale_cmake_cmakelint_options =
\   get(g:, 'ale_cmake_cmakelint_options', '')

function! ale_linters#cmake#cmakelint#Executable(buffer) abort
    return g:ale_cmake_cmakelint_executable
endfunction

function! ale_linters#cmake#cmakelint#Command(buffer) abort
    return ale_linters#cmake#cmakelint#Executable(a:buffer)
    \   . ' ' . g:ale_cmake_cmakelint_options . ' %t'
endfunction

call ale#linter#Define('cmake', {
\   'name': 'cmakelint',
\   'executable_callback': 'ale_linters#cmake#cmakelint#Executable',
\   'command_callback': 'ale_linters#cmake#cmakelint#Command',
\   'callback': 'ale#handlers#HandleUnixFormatAsWarning',
\})