diff options
author | Arash Mousavi <mousavi.arash@gmail.com> | 2023-07-24 13:38:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-24 21:38:52 +0900 |
commit | 93a4f70414cf6b632083127998ad5c80b1615e2e (patch) | |
tree | d0a7559b15d6c9920b9f60a4012ee4ee01943737 /autoload | |
parent | 3d107703873a67e6645b5c7ed0ccb273ac0596b2 (diff) | |
download | ale-93a4f70414cf6b632083127998ad5c80b1615e2e.zip |
Add erb-formatter support (#4546)
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/fix/registry.vim | 5 | ||||
-rw-r--r-- | autoload/ale/fixers/erbformatter.vim | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index 2f7edba8..a0e0c530 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -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.', \ } \} diff --git a/autoload/ale/fixers/erbformatter.vim b/autoload/ale/fixers/erbformatter.vim new file mode 100644 index 00000000..7bb43e0c --- /dev/null +++ b/autoload/ale/fixers/erbformatter.vim @@ -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 |