ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Global indent width setting

Open ipeglin opened this issue 9 months ago • 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.

ipeglin avatar May 01 '24 08:05 ipeglin

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

MichaReiser avatar May 01 '24 09:05 MichaReiser

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"],
}

charliermarsh avatar May 03 '24 00:05 charliermarsh

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.

snowsignal avatar May 03 '24 13:05 snowsignal