From 7dbd3c96ac1eb3a1981e740423a31500108f6e25 Mon Sep 17 00:00:00 2001 From: "Guillermo R. Roig Carralero" Date: Sun, 26 Mar 2023 06:38:24 +0000 Subject: Add support for `rustywind` fixer (#4477) --- autoload/ale/fix/registry.vim | 5 +++++ autoload/ale/fixers/rustywind.vim | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 autoload/ale/fixers/rustywind.vim (limited to 'autoload') diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index b3275a32..f7fff6a7 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -600,6 +600,11 @@ let s:default_registry = { \ 'function': 'ale#fixers#pycln#Fix', \ 'suggested_filetypes': ['python'], \ 'description': 'remove unused python import statements', +\ }, +\ 'rustywind': { +\ 'function': 'ale#fixers#rustywind#Fix', +\ 'suggested_filetypes': ['html'], +\ 'description': 'Sort Tailwind CSS classes', \ } \} diff --git a/autoload/ale/fixers/rustywind.vim b/autoload/ale/fixers/rustywind.vim new file mode 100644 index 00000000..5e9bb3c5 --- /dev/null +++ b/autoload/ale/fixers/rustywind.vim @@ -0,0 +1,17 @@ +scriptencoding utf-8 +" Author: Guillermo Roig +" Description: Sort TailwindCSS classes with rustywind + +call ale#Set('html_rustywind_executable', 'rustywind') +call ale#Set('html_rustywind_options', '') + +function! ale#fixers#rustywind#Fix(buffer) abort + let l:executable = ale#Var(a:buffer, 'html_rustywind_executable') + let l:options = ale#Var(a:buffer, 'html_rustywind_options') + + return { + \ 'command': ale#Escape(l:executable) + \ . (empty(l:options) ? '' : ' ' . l:options) + \ . ' --stdin' + \} +endfunction -- cgit v1.2.3