summaryrefslogtreecommitdiff
path: root/autoload/ale
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/ale')
-rw-r--r--autoload/ale/fix/registry.vim5
-rw-r--r--autoload/ale/fixers/erbformatter.vim13
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