mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-30 14:45:29 +08:00
Add support for rustywind fixer (#4477)
This commit is contained in:
committed by
GitHub
parent
fbae1bc193
commit
7dbd3c96ac
@@ -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',
|
||||
\ }
|
||||
\}
|
||||
|
||||
|
||||
17
autoload/ale/fixers/rustywind.vim
Normal file
17
autoload/ale/fixers/rustywind.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
scriptencoding utf-8
|
||||
" Author: Guillermo Roig <groig@protonmail.com>
|
||||
" 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
|
||||
Reference in New Issue
Block a user