Skip to content

Commit

Permalink
fix(biome): use temp file instead of stdin (#4775)
Browse files Browse the repository at this point in the history
biome handles utf8 characters differently between files and stdin, and
in some cases can replace emojis with ascii characters when using stdin

refs: biomejs/biome#2604
  • Loading branch information
redbmk authored Jun 20, 2024
1 parent c7c41e1 commit 0cd64c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion autoload/ale/fixers/biome.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ function! ale#fixers#biome#Fix(buffer) abort
let l:options = ale#Var(a:buffer, 'biome_options')

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

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

0 comments on commit 0cd64c8

Please sign in to comment.