Skip to content

Cannot configure/disable the rust formatter #7317

@marc2332

Description

@marc2332

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions