From 7e0e7359c02632db299eca8224860e3beab72824 Mon Sep 17 00:00:00 2001 From: rcn Date: Thu, 13 Apr 2017 00:23:25 +0200 Subject: Add puppet-lint config options and documentation (#462) --- ale_linters/puppet/puppetlint.vim | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'ale_linters/puppet/puppetlint.vim') diff --git a/ale_linters/puppet/puppetlint.vim b/ale_linters/puppet/puppetlint.vim index f96f8f79..0dfd934a 100644 --- a/ale_linters/puppet/puppetlint.vim +++ b/ale_linters/puppet/puppetlint.vim @@ -1,10 +1,26 @@ -" Author: Alexander Olofsson +" Author: Alexander Olofsson , Robert Flechtner +" 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 = +\ get(g:, 'ale_puppet_puppetlint_options', '') + +function! ale_linters#puppet#puppetlint#GetExecutable(buffer) abort + return g:ale_puppet_puppetlint_executable +endfunction + +function! ale_linters#puppet#puppetlint#GetCommand(buffer) abort + return ale_linters#puppet#puppetlint#GetExecutable(a:buffer) + \ . ' ' . g:ale_puppet_puppetlint_options + \ . ' --log-format "-:%{line}:%{column}: %{kind}: [%{check}] %{message}"' + \ . ' %t' +endfunction call ale#linter#Define('puppet', { \ 'name': 'puppetlint', -\ 'executable': 'puppet-lint', -\ 'command': 'puppet-lint --no-autoloader_layout-check' -\ . ' --log-format "-:%{line}:%{column}: %{kind}: [%{check}] %{message}"' -\ . ' %t', +\ 'executable_callback': 'ale_linters#puppet#puppetlint#GetExecutable', +\ 'command_callback': 'ale_linters#puppet#puppetlint#GetCommand', \ 'callback': 'ale#handlers#gcc#HandleGCCFormat', \}) -- cgit v1.2.3