mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-24 17:28:42 +08:00
add fish_indent fixer
This commit is contained in:
@@ -180,6 +180,11 @@ let s:default_registry = {
|
|||||||
\ 'suggested_filetypes': ['cmake'],
|
\ 'suggested_filetypes': ['cmake'],
|
||||||
\ 'description': 'Fix CMake files with cmake-format.',
|
\ 'description': 'Fix CMake files with cmake-format.',
|
||||||
\ },
|
\ },
|
||||||
|
\ 'fish_indent': {
|
||||||
|
\ 'function': 'ale#fixers#fish_indent#Fix',
|
||||||
|
\ 'suggested_filetypes': ['fish'],
|
||||||
|
\ 'description': 'Fix fish shell scripts with fish_indent.',
|
||||||
|
\ },
|
||||||
\ 'gofmt': {
|
\ 'gofmt': {
|
||||||
\ 'function': 'ale#fixers#gofmt#Fix',
|
\ 'function': 'ale#fixers#gofmt#Fix',
|
||||||
\ 'suggested_filetypes': ['go'],
|
\ 'suggested_filetypes': ['go'],
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
" Author: Chen YuanYuan <cyyever@outlook.com>
|
||||||
|
" Description: Integration of fish_indent with ALE.
|
||||||
|
|
||||||
|
call ale#Set('fish_indent_executable', 'fish_indent')
|
||||||
|
call ale#Set('fish_indent_options', '')
|
||||||
|
|
||||||
|
function! ale#fixers#fish_indent#Fix(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'fish_indent_executable')
|
||||||
|
let l:options = ale#Var(a:buffer, '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
|
||||||
Reference in New Issue
Block a user