You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.
Log file
10:20:26[DEBUG] Running formatters on /Users/jbrown/tmp/2023-10-22/test.rb: { "rubyfmt" }
10:20:26[INFO] Run rubyfmt on /Users/jbrown/tmp/2023-10-22/test.rb
10:20:26[DEBUG] Run command: { "rubyfmt" }
10:20:27[DEBUG] rubyfmt exited with code 1
Describe the bug
When run on a file with invalid syntax, rubyfmt outputs no text and exits with status 1. It looks like conform doesn't understand this, so replaces the buffer contents with the empty string.
Steps To Reproduce
install rubyfmt and configure it in conform
echo -e "clas Foo\nend" > test.rb
nvim -u repro.lua test.rb
:w
Expected Behavior
Buffer is unchanged and an error is reported
Minimal example file
clasFooend
Minimal init.lua
-- DO NOT change the paths and don't remove the colorschemelocalroot=vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .reprofor_, nameinipairs({ "config", "data", "state", "cache" }) dovim.env[("XDG_%s_HOME"):format(name:upper())] =root.."/" ..nameend-- bootstrap lazylocallazypath=root.."/plugins/lazy.nvim"ifnotvim.loop.fs_stat(lazypath) thenvim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
endvim.opt.runtimepath:prepend(lazypath)
-- install pluginslocalplugins= {
"folke/tokyonight.nvim",
{
"stevearc/conform.nvim",
config=function()
require("conform").setup({
log_level=vim.log.levels.DEBUG,
formatters_by_ft= {
ruby= {"rubyfmt"}
},
format_on_save= {
lsp_fallback=true,
timeout_ms=500,
},
notify_on_error=true,
})
end,
},
}
require("lazy").setup(plugins, {
root=root.."/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
Additional context
I think this might just be a matter of changing exit_codes from {0, 1} to {0} in rubyfmt.lua but I don't know enough about this project to say for sure.
The text was updated successfully, but these errors were encountered:
@hahuang65 is there a reason you included exit_codes = { 0, 1 } as part of #139? I tried looking for documentation of rubyfmt exit codes but couldn't find anything.
Neovim version (nvim -v)
0.9.4
Operating system/version
macOS 14.0
Add the debug logs
log_level = vim.log.levels.DEBUG
and pasted the log contents below.Log file
Describe the bug
When run on a file with invalid syntax,
rubyfmt
outputs no text and exits with status 1. It looks likeconform
doesn't understand this, so replaces the buffer contents with the empty string.Steps To Reproduce
echo -e "clas Foo\nend" > test.rb
nvim -u repro.lua test.rb
:w
Expected Behavior
Buffer is unchanged and an error is reported
Minimal example file
Minimal init.lua
Additional context
I think this might just be a matter of changing
exit_codes
from{0, 1}
to{0}
inrubyfmt.lua
but I don't know enough about this project to say for sure.The text was updated successfully, but these errors were encountered: