diff options
author | w0rp <devw0rp@gmail.com> | 2018-08-02 23:44:12 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-08-02 23:44:12 +0100 |
commit | 217284360d35711b751859ed27a7a3c3da300e85 (patch) | |
tree | 4b26a84b397e3ac15a8b13a572b1f9a50312dbab /ale_linters/puppet/puppetlint.vim | |
parent | 9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff) | |
download | ale-217284360d35711b751859ed27a7a3c3da300e85.zip |
Simplify the code for most linters and tests with closures
Diffstat (limited to 'ale_linters/puppet/puppetlint.vim')
-rw-r--r-- | ale_linters/puppet/puppetlint.vim | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/ale_linters/puppet/puppetlint.vim b/ale_linters/puppet/puppetlint.vim index 13da511b..c9c16f5e 100644 --- a/ale_linters/puppet/puppetlint.vim +++ b/ale_linters/puppet/puppetlint.vim @@ -1,26 +1,18 @@ " 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', '--no-autoloader_layout-check') - -function! ale_linters#puppet#puppetlint#GetExecutable(buffer) abort - return ale#Var(a:buffer, 'puppet_puppetlint_executable') -endfunction +call ale#Set('puppet_puppetlint_executable', 'puppet-lint') +call ale#Set('puppet_puppetlint_options', '--no-autoloader_layout-check') function! ale_linters#puppet#puppetlint#GetCommand(buffer) abort - return ale_linters#puppet#puppetlint#GetExecutable(a:buffer) - \ . ' ' . ale#Var(a:buffer, 'puppet_puppetlint_options') + return '%e' . ale#Pad(ale#Var(a:buffer, 'puppet_puppetlint_options')) \ . ' --log-format "-:%{line}:%{column}: %{kind}: [%{check}] %{message}"' \ . ' %t' endfunction call ale#linter#Define('puppet', { \ 'name': 'puppetlint', -\ 'executable_callback': 'ale_linters#puppet#puppetlint#GetExecutable', +\ 'executable_callback': ale#VarFunc('puppet_puppetlint_executable'), \ 'command_callback': 'ale_linters#puppet#puppetlint#GetCommand', \ 'callback': 'ale#handlers#gcc#HandleGCCFormat', \}) |