mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-24 09:18:42 +08:00
Add erb-formatter support (#4546)
This commit is contained in:
@@ -615,6 +615,11 @@ let s:default_registry = {
|
||||
\ 'function': 'ale#fixers#npmgroovylint#Fix',
|
||||
\ 'suggested_filetypes': ['groovy'],
|
||||
\ 'description': 'Fix Groovy files with npm-groovy-fix.',
|
||||
\ },
|
||||
\ 'erb-formatter': {
|
||||
\ 'function': 'ale#fixers#erbformatter#Fix',
|
||||
\ 'suggested_filetypes': ['eruby'],
|
||||
\ 'description': 'Apply erb-formatter -w to eruby/erb files.',
|
||||
\ }
|
||||
\}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
" Author: Arash Mousavi <arash-m>
|
||||
" Description: Support for ERB::Formetter https://github.com/nebulab/erb-formatter
|
||||
|
||||
call ale#Set('eruby_erbformatter_executable', 'erb-formatter')
|
||||
|
||||
function! ale#fixers#erbformatter#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'eruby_erbformatter_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' -w %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user