summaryrefslogtreecommitdiff
path: root/ale_linters/puppet/puppetlint.vim
diff options
context:
space:
mode:
authorrcn <tellme@deadmetropolis.de>2017-04-13 00:23:25 +0200
committerw0rp <w0rp@users.noreply.github.com>2017-04-12 23:23:25 +0100
commit7e0e7359c02632db299eca8224860e3beab72824 (patch)
tree64f4662f541a5242c16c20a2293fdd34e0691283 /ale_linters/puppet/puppetlint.vim
parentceb910e78cf95a8db71ad3f3a39a97db35d1b9f3 (diff)
downloadale-7e0e7359c02632db299eca8224860e3beab72824.zip
Add puppet-lint config options and documentation (#462)
Diffstat (limited to 'ale_linters/puppet/puppetlint.vim')
-rw-r--r--ale_linters/puppet/puppetlint.vim26
1 files changed, 21 insertions, 5 deletions
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 <alexander.olofsson@liu.se>
+" 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 =
+\ 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',
\})