mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-02 17:43:33 +08:00
Add puppet-lint fixer (#701)
* Add puppet-lint fixer * Add vader test for puppetlint fixer * Ensure puppetlint variables are initialized
This commit is contained in:
committed by
w0rp
parent
f984c5fb83
commit
f883d4d4fd
@@ -32,6 +32,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['javascript'],
|
||||
\ 'description': 'Apply prettier-eslint to a file.',
|
||||
\ },
|
||||
\ 'puppetlint': {
|
||||
\ 'function': 'ale#fixers#puppetlint#Fix',
|
||||
\ 'suggested_filetypes': ['puppet'],
|
||||
\ 'description': 'Run puppet-lint -f on a file.',
|
||||
\ },
|
||||
\ 'remove_trailing_lines': {
|
||||
\ 'function': 'ale#fixers#generic#RemoveTrailingBlankLines',
|
||||
\ 'suggested_filetypes': [],
|
||||
|
||||
21
autoload/ale/fixers/puppetlint.vim
Normal file
21
autoload/ale/fixers/puppetlint.vim
Normal file
@@ -0,0 +1,21 @@
|
||||
" Author: Alexander Olofsson <alexander.olofsson@liu.se>
|
||||
" Description: puppet-lint fixer
|
||||
|
||||
if !exists('g:ale_puppet_puppetlint_executable')
|
||||
let g:ale_puppet_puppetlint_executable = 'puppet-lint'
|
||||
endif
|
||||
if !exists('g:ale_puppet_puppetlint_options')
|
||||
let g:ale_puppet_puppetlint_options = ''
|
||||
endif
|
||||
|
||||
function! ale#fixers#puppetlint#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'puppet_puppetlint_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' ' . ale#Var(a:buffer, 'puppet_puppetlint_options')
|
||||
\ . ' --fix'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user