mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-02 09:33:31 +08:00
Add alejandra for nix (#4435)
- Fixes https://github.com/dense-analysis/ale/issues/4434
This commit is contained in:
@@ -7,6 +7,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['python'],
|
||||
\ 'description': 'Add blank lines before control statements.',
|
||||
\ },
|
||||
\ 'alejandra': {
|
||||
\ 'function': 'ale#fixers#alejandra#Fix',
|
||||
\ 'suggested_filetypes': ['nix'],
|
||||
\ 'description': 'The Uncompromising Nix Code Formatter',
|
||||
\ },
|
||||
\ 'align_help_tags': {
|
||||
\ 'function': 'ale#fixers#help#AlignTags',
|
||||
\ 'suggested_filetypes': ['help'],
|
||||
|
||||
13
autoload/ale/fixers/alejandra.vim
Normal file
13
autoload/ale/fixers/alejandra.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
call ale#Set('nix_alejandra_executable', 'alejandra')
|
||||
call ale#Set('nix_alejandra_options', '')
|
||||
|
||||
function! ale#fixers#alejandra#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'nix_alejandra_executable')
|
||||
let l:options = ale#Var(a:buffer, 'nix_alejandra_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' -- -'
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user