astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Config argument specificied in `ruff.lint.args` is ignored by the formatter

luctowers opened this issue · comments

settings.json

{
    "ruff.lint.args": ["--config=/path/to/.ruff.toml"]
}

/path/to/.ruff.toml

line-length = 80
indent-width = 4
[format]
quote-style = "double"
indent-style = "tab"

Operating System: Debian (Devcontainer running on Docker for Mac)
Python Version: 3.12
Ruff Version: 0.2.1
Extension Version: v2024.10.0

When I format my python code with the above setup it does not obey the config file.

Setups that do work for me:

  1. Placing the .ruff.toml in the root of my project
  2. Manually formatting with ruff format --config=/path/to/.ruff.toml

Ah sorry, you need to specify the config file for the format command:

{
    "ruff.format.args": ["--config=/path/to/.ruff.toml"]
}

I see, awesome thanks :)