mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-27 13:22:17 +08:00
Implement support for apkbuild-fixer (#4881)
I am not the author of a single file, but have full permissions from the original author for permission for submitting this to ALE under the 2-Clause BSD licence. See: https://gitlab.alpinelinux.org/Leo/apkbuild.vim/-/issues/3
This commit is contained in:
@@ -17,6 +17,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['help'],
|
||||
\ 'description': 'Align help tags to the right margin',
|
||||
\ },
|
||||
\ 'apkbuild-fixer': {
|
||||
\ 'function': 'ale#fixers#apkbuild_fixer#Fix',
|
||||
\ 'suggested_filetypes': ['apkbuild'],
|
||||
\ 'description': 'Fix policy violations found by apkbuild-lint in APKBUILDs',
|
||||
\ },
|
||||
\ 'autoimport': {
|
||||
\ 'function': 'ale#fixers#autoimport#Fix',
|
||||
\ 'suggested_filetypes': ['python'],
|
||||
|
||||
19
autoload/ale/fixers/apkbuild_fixer.vim
Normal file
19
autoload/ale/fixers/apkbuild_fixer.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
" Author: Leo <thinkabit.ukim@gmail.com>
|
||||
" Description: Fix policy violations found by apkbuild-lint
|
||||
|
||||
call ale#Set('apkbuild_apkbuild_fixer_executable', 'apkbuild-fixer')
|
||||
call ale#Set('apkbuild_apkbuild_fixer_lint_executable', get(g:, 'ale_apkbuild_apkbuild_lint_executable'))
|
||||
call ale#Set('apkbuild_apkbuild_fixer_options', '')
|
||||
|
||||
function! ale#fixers#apkbuild_fixer#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'apkbuild_apkbuild_fixer_executable')
|
||||
let l:options = ale#Var(a:buffer, 'apkbuild_apkbuild_fixer_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -p ' . ale#Var(a:buffer, 'apkbuild_apkbuild_fixer_lint_executable')
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user