mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
biome: use --stdin-file-path for fixer (#5051)
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
function! ale#fixers#biome#Fix(buffer) abort
|
function! ale#fixers#biome#Fix(buffer) abort
|
||||||
let l:executable = ale#handlers#biome#GetExecutable(a:buffer)
|
let l:executable = ale#handlers#biome#GetExecutable(a:buffer)
|
||||||
let l:options = ale#Var(a:buffer, 'biome_options')
|
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 {
|
return {
|
||||||
\ 'read_temporary_file': 1,
|
\ 'command': ale#Escape(l:executable) . ' check '
|
||||||
\ 'command': ale#Escape(l:executable) . ' check ' . l:apply
|
\ . '--write --stdin-file-path %s' . l:unsafe
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' %t'
|
|
||||||
\}
|
\}
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -15,9 +15,8 @@ Execute(The default biome command should be correct):
|
|||||||
|
|
||||||
AssertFixer
|
AssertFixer
|
||||||
\ {
|
\ {
|
||||||
\ 'read_temporary_file': 1,
|
|
||||||
\ 'command': ale#Escape('biome')
|
\ 'command': ale#Escape('biome')
|
||||||
\ . ' check --write %t'
|
\ . ' check --write --stdin-file-path %s'
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
Execute(Unsafe fixes can be applied via an option):
|
Execute(Unsafe fixes can be applied via an option):
|
||||||
@@ -26,9 +25,8 @@ Execute(Unsafe fixes can be applied via an option):
|
|||||||
|
|
||||||
AssertFixer
|
AssertFixer
|
||||||
\ {
|
\ {
|
||||||
\ 'read_temporary_file': 1,
|
|
||||||
\ 'command': ale#Escape('biome')
|
\ 'command': ale#Escape('biome')
|
||||||
\ . ' check --write --unsafe %t'
|
\ . ' check --write --stdin-file-path %s --unsafe'
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
Execute(The fixer should accept options):
|
Execute(The fixer should accept options):
|
||||||
@@ -37,7 +35,6 @@ Execute(The fixer should accept options):
|
|||||||
|
|
||||||
AssertFixer
|
AssertFixer
|
||||||
\ {
|
\ {
|
||||||
\ 'read_temporary_file': 1,
|
|
||||||
\ 'command': ale#Escape('biome')
|
\ 'command': ale#Escape('biome')
|
||||||
\ . ' check --write --foobar %t',
|
\ . ' check --write --stdin-file-path %s --foobar',
|
||||||
\ }
|
\ }
|
||||||
|
|||||||
Reference in New Issue
Block a user