Skip to content

formatter name for uv mismatch between documentation and codebase #9406

@paulclou

Description

@paulclou

Description

The uv formatter's internal name is uv format, mismatching the name shown in documentation as uv.

From docs/formatters
Image

But internal name is uv format instead

export const uvformat: Info = {
  name: "uv format",
  command: ["uv", "format", "--", "$FILE"],
  extensions: [".py", ".pyi"],

This results in configuration ignored inside opencode.jsonc

{
  "formatter": {
    "ruff": { "disabled": true },
    "uv": { "disabled": true }     // <-- ignored
  }
}

Plugins

No response

OpenCode version

No response

Steps to reproduce

# Install uv, then add "formatter" attribute into opencode.jsonc
grep \"formatter -A 3 ~/.config/opencode/opencode.jsonc
#  "formatter": {
#    "ruff": { "disabled": true },
#    "uv": { "disabled": true }
#  },

# create test file and execute opencode
echo "if True: print('42')" > test.py
opencode run 'add shebang for @test.py, then remove it'
cat test.py
# if True:
#     print("42")
# ^ standard formatting applied

# replace "uv" with "uv format", then re-create and re-run opencode
sed -i 's/uv/uv format/g' ~/.config/opencode/opencode.jsonc
echo "if True: print('42')" > test.py
opencode run 'add shebang for @test.py, then remove it'
cat test.py
# if True: print('42')
# ^ no formatting

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions