Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Pomurnik opened this issue Jun 4, 2024 · 1 comment

Comments

@Pomurnik
Copy link

Pomurnik commented Jun 4, 2024

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!

@dhruvmanila
Copy link
Member

Can you try this with the latest version? It's working fine for me i.e., it's expanding the ${workspaceFolder} variable:

2024-07-23 09:50:19.778 [info] Running Ruff with: /Users/dhruv/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--config=/Users/dhruv/playground/ruff/pyproject.toml', '--stdin-filename', '/Users/dhruv/playground/ruff/src/lsp.py']

You can refer to logs with either Ruff: Show Logs command or Developer: Show Logs (select "Ruff").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants