mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-20 18:14:33 +08:00
Add cljfmt fixer for clojure files (#4860)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
This commit is contained in:
@@ -672,6 +672,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['ruby'],
|
||||
\ 'description': 'A formatter for Ruby source code',
|
||||
\ },
|
||||
\ 'cljfmt': {
|
||||
\ 'function': 'ale#fixers#cljfmt#Fix',
|
||||
\ 'suggested_filetypes': ['clojure'],
|
||||
\ 'description': 'formatter and linter for clojure files',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
14
autoload/ale/fixers/cljfmt.vim
Normal file
14
autoload/ale/fixers/cljfmt.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Author: rudolf ordoyne <rudolfordoyne@protonmail.com>
|
||||
" Description: Support for cljfmt https://github.com/weavejester/cljfmt
|
||||
|
||||
call ale#Set('clojure_cljfmt_executable', 'cljfmt')
|
||||
|
||||
function! ale#fixers#cljfmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'clojure_cljfmt_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' fix %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user