2017-04-12 18:23:25 -04:00
|
|
|
" Author: Alexander Olofsson <alexander.olofsson@liu.se>, Robert Flechtner <flechtner@chemmedia.de>
|
|
|
|
" Description: puppet-lint for puppet files
|
|
|
|
|
|
|
|
let g:ale_puppet_puppetlint_executable =
|
|
|
|
\ get(g:, 'ale_puppet_puppetlint_executable', 'puppet-lint')
|
|
|
|
|
|
|
|
let g:ale_puppet_puppetlint_options =
|
2017-04-12 18:25:31 -04:00
|
|
|
\ get(g:, 'ale_puppet_puppetlint_options', '--no-autoloader_layout-check')
|
2017-04-12 18:23:25 -04:00
|
|
|
|
|
|
|
function! ale_linters#puppet#puppetlint#GetExecutable(buffer) abort
|
2017-04-15 20:24:08 -04:00
|
|
|
return ale#Var(a:buffer, 'puppet_puppetlint_executable')
|
2017-04-12 18:23:25 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! ale_linters#puppet#puppetlint#GetCommand(buffer) abort
|
|
|
|
return ale_linters#puppet#puppetlint#GetExecutable(a:buffer)
|
2017-04-15 20:24:08 -04:00
|
|
|
\ . ' ' . ale#Var(a:buffer, 'puppet_puppetlint_options')
|
2017-04-12 18:23:25 -04:00
|
|
|
\ . ' --log-format "-:%{line}:%{column}: %{kind}: [%{check}] %{message}"'
|
|
|
|
\ . ' %t'
|
|
|
|
endfunction
|
2016-11-25 07:00:07 -05:00
|
|
|
|
|
|
|
call ale#linter#Define('puppet', {
|
|
|
|
\ 'name': 'puppetlint',
|
2017-04-12 18:23:25 -04:00
|
|
|
\ 'executable_callback': 'ale_linters#puppet#puppetlint#GetExecutable',
|
|
|
|
\ 'command_callback': 'ale_linters#puppet#puppetlint#GetCommand',
|
2017-04-11 15:32:57 -04:00
|
|
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
2016-11-25 07:00:07 -05:00
|
|
|
\})
|