opencode
opencode copied to clipboard
Cannot configure/disable the rust formatter
Description
Tweaking or disabling the rust formatter config in opencode.json does not make opencode behave differently in any way, it keeps formatting with the built-in default command.
So for example, even with this config:
{
"$schema": "https://opencode.ai/config.json",
"formatter": {
"rustfmt": {
"disabled": true,
}
}
}
Or:
{
"$schema": "https://opencode.ai/config.json",
"formatter": {
"rustfmt": {
"command": [
"rustfmt",
"+nightly-2025-09-25",
"--error-on-unformatted",
"--unstable-features",
"$FILE"
],
"extensions": [".rs"]
}
}
}
It keeps formatting with the default command.
Plugins
None I think? just a baremetal opencode config
OpenCode version
1.1.6 (latest as of now)
Steps to reproduce
- Clone https://github.com/marc2332/opencode-broken-rustfmt
- Launch opencode
- Ask:
Change the 'nice' text in main.rs to 'Hello, World' - See that now opencode has not only changed said text but also formatted both
main.rsandother_file.rseven thoughopencode.jsonis clearly configured to disable rustfmt
Screenshot and/or share link
https://opncd.ai/share/KO2n2DWl
Operating System
Ubuntu 24.04
Terminal
Wezterm