Open
Description
Background: In most of my projects I have a pyproject.toml
file that has the linting rules I use. I want to be able to use a similar file in my IDE settings so that unless overwritten by a project file, I use standard RUFF rules. The complication is that I sync my settings.json
file accross many different computers, so having a "proper" absolute path will not work for me; I need to be able to use environment variables (or at least know where the "default" path is.
None of these seem to work.
// try 1
"ruff.lint.args": ["--config=%USERPROFILE%/pyproject.toml"],
"ruff.format.args": ["--config=%USERPROFILE%/pyproject.toml"],
// try 2
"ruff.lint.args": ["--config=${env:USERPROFILE%|/pyproject.toml"],
"ruff.format.args": ["--config=${env:USERPROFILE}/pyproject.toml"],
// try 3
"ruff.lint.args": ["--config=${USERPROFILE%|/pyproject.toml"],
"ruff.format.args": ["--config=${USERPROFILE}/pyproject.toml"],
I get the following error:
Ruff: Lint failed (error: invalid value '${env:USERPROFILE%|/pyproject.toml' for '--config <CONFIG_OPTION>' tip: A `--config` flag must either be a path to a `.toml` configuration file or a TOML `<KEY> = <VALUE>` pair overriding a specific configuration option It looks like you were trying to pass a path to a configuration file. The path `${env:USERPROFILE%|/pyproject.toml` does not point to a configuration file For more information, try '--help'. )