Skip to content

Disabling formatter.ruff does not stop Python auto-formatting because OpenCode runs uv format #21864

@Julfried

Description

@Julfried

Description

When I disable Ruff formatting in ~/.config/opencode/opencode.json, Python files are still auto-formatted after edits.
OpenCode appears to respect the config entry for formatter.ruff.disabled, but the formatter that actually runs is uv format, which still stays enabled.
This is confusing because uv format is documented as using the Ruff formatter and having the same behavior as ruff format. Based on that, disabling Ruff formatting should also disable the Python formatting path used by uv, or the config/docs should clearly state that uv is treated as a separate formatter.
Expected behavior:

  • Disabling Ruff formatting should stop Python auto-formatting.
    Actual behavior:
  • Python files are still reformatted after edits.
  • Logs show OpenCode running uv format -- $FILE.
    Config used:
{
  "formatter": {
    "ruff": {
      "disabled": true
    }
  }
}

I also confirmed OpenCode is loading that config correctly with opencode debug config.

Plugins

None

OpenCode version

1.4.3

Steps to reproduce

  1. Create this config in ~/.config/opencode/opencode.json:
{
  "formatter": {
    "ruff": {
      "disabled": true
    }
  }
}
  1. Run opencode debug config and confirm it resolves to:
{
  "formatter": {
    "ruff": {
      "disabled": true
    }
  }
}
  1. Open a Python project in OpenCode.
  2. Ask OpenCode to make a small change to a .py file.
  3. Observe that formatting is still applied automatically.
  4. Check the OpenCode logs and see entries like:
    service=format file=/path/to/file.py formatting
    service=format name=uv ext=.py enabled
    service=format command=["uv","format","--","$FILE"] running

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04

Terminal

VS Code integrated terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions