Merge pull request #3576 from cyyever/fish_indent

Fish indent
This commit is contained in:
Horacio Sanson
2021-02-05 22:58:43 +09:00
committed by GitHub
8 changed files with 84 additions and 0 deletions

View File

@@ -216,6 +216,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['cmake'],
\ 'description': 'Fix CMake files with cmake-format.',
\ },
\ 'fish_indent': {
\ 'function': 'ale#fixers#fish_indent#Fix',
\ 'suggested_filetypes': ['fish'],
\ 'description': 'Format fish scripts using fish_indent.',
\ },
\ 'gofmt': {
\ 'function': 'ale#fixers#gofmt#Fix',
\ 'suggested_filetypes': ['go'],

View File

@@ -0,0 +1,19 @@
" Author: Chen YuanYuan <cyyever@outlook.com>
" Description: Integration of fish_indent with ALE.
call ale#Set('fish_fish_indent_executable', 'fish_indent')
call ale#Set('fish_fish_indent_options', '')
function! ale#fixers#fish_indent#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'fish_fish_indent_executable')
let l:options = ale#Var(a:buffer, 'fish_fish_indent_options')
let l:filename = ale#Escape(bufname(a:buffer))
return {
\ 'command': ale#Escape(l:executable)
\ . ' -w '
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction