From 4d132b3ffa5c42c882fccdf970ddb3f0063ee599 Mon Sep 17 00:00:00 2001 From: David Dominguez <352985+ddominguez@users.noreply.github.com> Date: Sat, 2 Mar 2024 02:05:47 -0500 Subject: [PATCH] Fix biome formatter (#4733) * Fix biome formatter Added escaped executable to the biome#Fix command * Added fixer callback test --- autoload/ale/fixers/biome.vim | 2 +- test/fixers/test_biome_fixer_callback.vader | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test/fixers/test_biome_fixer_callback.vader diff --git a/autoload/ale/fixers/biome.vim b/autoload/ale/fixers/biome.vim index 903d7f39..0f210657 100644 --- a/autoload/ale/fixers/biome.vim +++ b/autoload/ale/fixers/biome.vim @@ -3,7 +3,7 @@ function! ale#fixers#biome#Fix(buffer) abort let l:options = ale#Var(a:buffer, 'biome_options') return { - \ 'command': '%e format' + \ 'command': ale#Escape(l:executable) . ' format' \ . (!empty(l:options) ? ' ' . l:options : '') \ . ' --stdin-file-path=%s', \} diff --git a/test/fixers/test_biome_fixer_callback.vader b/test/fixers/test_biome_fixer_callback.vader new file mode 100644 index 00000000..632a7ec4 --- /dev/null +++ b/test/fixers/test_biome_fixer_callback.vader @@ -0,0 +1,15 @@ +Before: + call ale#assert#SetUpFixerTest('typescript', 'biome') + +After: + call ale#assert#TearDownFixerTest() + +Execute(The default biome command should be correct): + call ale#test#SetFilename('../test-files/typescript/test.ts') + + AssertFixer + \ { + \ 'command': ale#Escape('biome') + \ . ' format --stdin-file-path=%s' + \ } +