opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Cannot configure/disable the rust formatter

Open marc2332 opened this issue 1 week ago • 1 comments

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

  1. Clone https://github.com/marc2332/opencode-broken-rustfmt
  2. Launch opencode
  3. Ask: Change the 'nice' text in main.rs to 'Hello, World'
  4. See that now opencode has not only changed said text but also formatted both main.rs and other_file.rs even though opencode.json is clearly configured to disable rustfmt

Screenshot and/or share link

https://opncd.ai/share/KO2n2DWl

Operating System

Ubuntu 24.04

Terminal

Wezterm

marc2332 avatar Jan 08 '26 10:01 marc2332