Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions autoload/ale/fixers/biome.vim
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
function! ale#fixers#biome#Fix(buffer) abort
let l:executable = ale#handlers#biome#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'biome_options')
let l:apply = ale#Var(a:buffer, 'biome_fixer_apply_unsafe') ? '--write --unsafe' : '--write'
let l:unsafe = ale#Var(a:buffer, 'biome_fixer_apply_unsafe') ? ' --unsafe' : ''

return {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(l:executable) . ' check ' . l:apply
\ 'command': ale#Escape(l:executable) . ' check '
\ . '--write --stdin-file-path %s' . l:unsafe
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
\}
endfunction
9 changes: 3 additions & 6 deletions test/fixers/test_biome_fixer_callback.vader
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ Execute(The default biome command should be correct):

AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape('biome')
\ . ' check --write %t'
\ . ' check --write --stdin-file-path %s'
\ }

Execute(Unsafe fixes can be applied via an option):
Expand All @@ -26,9 +25,8 @@ Execute(Unsafe fixes can be applied via an option):

AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape('biome')
\ . ' check --write --unsafe %t'
\ . ' check --write --stdin-file-path %s --unsafe'
\ }

Execute(The fixer should accept options):
Expand All @@ -37,7 +35,6 @@ Execute(The fixer should accept options):

AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape('biome')
\ . ' check --write --foobar %t',
\ . ' check --write --stdin-file-path %s --foobar',
\ }