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

This commit is contained in:
rudolf ordoyne
2024-11-16 20:22:36 -06:00
committed by GitHub
parent 5cc6b933b1
commit defb0ea336
7 changed files with 46 additions and 0 deletions

View File

@@ -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.

View 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