2017-02-25 12:27:03 -05:00
|
|
|
" 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
|
2017-04-15 20:24:08 -04:00
|
|
|
return ale#Var(a:buffer, 'cmake_cmakelint_executable')
|
2017-02-25 12:27:03 -05:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! ale_linters#cmake#cmakelint#Command(buffer) abort
|
|
|
|
return ale_linters#cmake#cmakelint#Executable(a:buffer)
|
2017-04-15 20:24:08 -04:00
|
|
|
\ . ' ' . ale#Var(a:buffer, 'cmake_cmakelint_options') . ' %t'
|
2017-02-25 12:27:03 -05:00
|
|
|
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',
|
|
|
|
\})
|