astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.
Other
945 stars 45 forks source link

Fail to recognize the Ruff config file path for lintning in the VSCode settings.json #486

Open Pomurnik opened 1 month ago

Pomurnik commented 1 month ago

Environment

Ruff Extension: v2024.24.0 VSCode: 1.88.1 OS: Windows 10 Python: 3.8.15 Ruff: 0.4.7 Import Strategy: fromEnvironment

Description

"ruff.lint.args": [
      "--config=${workspaceFolder}/pyproject.toml"
  ],
"ruff.format.args": [
    "--config=${workspaceFolder}/pyproject.toml"
]

Here is the error message.

Ruff: Lint failed (error: invalid value '${workspaceFolder}/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 `{workspaceFolder}/pyproject.toml` does not exist For more information, try '--help'. ) 

Formatting works well and recognizes the path to pyproject.toml, unfortunately the error appears with the same path for lint.

Thanks!