astral-sh/ruff

Global indent width setting

ipeglin opened this issue · 3 comments

I would very much like to see a global VSCode extension setting for indent width, that omits the need for a ruff.toml or pyproject.toml. I personally prefer a different indent size than 4, and it seems really unnecessary to constantly create a local configuration file for such a small change in the config.

You can change the formatArgs and lintArgs to include a --config indent-width=2. I'm not sure if the new LSP will have a setting for this that doesn't require a configuration file. CC: @snowsignal

Yeah this is currently solvable without creating a configuration file, with the following in your settings.json:

{
    "ruff.lint.args": ["--config", "indent-width=2"],
    "ruff.format.args": ["--config", "indent-width=2"],
}

Even though the current LSP supports this, our new LSP would require this to be in a configuration file at the moment, and I'd like to have this as an proper editor setting.