mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-01 23:55:33 +08:00
@@ -179,7 +179,12 @@ let s:default_registry = {
|
||||
\ 'yamlfix': {
|
||||
\ 'function': 'ale#fixers#yamlfix#Fix',
|
||||
\ 'suggested_filetypes': ['yaml'],
|
||||
\ 'description': 'Fix yaml files with yamlfix.',
|
||||
\ 'description': 'Fix YAML files with yamlfix.',
|
||||
\ },
|
||||
\ 'yamlfmt': {
|
||||
\ 'function': 'ale#fixers#yamlfmt#Fix',
|
||||
\ 'suggested_filetypes': ['yaml'],
|
||||
\ 'description': 'Format YAML files with yamlfmt.',
|
||||
\ },
|
||||
\ 'yapf': {
|
||||
\ 'function': 'ale#fixers#yapf#Fix',
|
||||
|
||||
20
autoload/ale/fixers/yamlfmt.vim
Normal file
20
autoload/ale/fixers/yamlfmt.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Author: https://github.com/Spixmaster
|
||||
" Description: Format YAML files with yamlfmt.
|
||||
|
||||
call ale#Set('yaml_yamlfmt_executable', 'yamlfmt')
|
||||
call ale#Set('yaml_yamlfmt_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('yaml_yamlfmt_options', '')
|
||||
|
||||
function! ale#fixers#yamlfmt#Fix(buffer) abort
|
||||
let l:executable = ale#python#FindExecutable(
|
||||
\ a:buffer,
|
||||
\ 'yaml_yamlfmt',
|
||||
\ ['yamlfmt']
|
||||
\)
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'yaml_yamlfmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' ' . l:options . ' -in',
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user