-
Notifications
You must be signed in to change notification settings - Fork 46
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 in the VSCode settings.json #413
Comments
Hmm. It could be because we fail to expand $HOME. |
We have the same problem using environment variables like "ruff.path": [
"${workspaceFolder}/dist/export/python/virtualenvs/ruff/${env:PYTHON_VERSION}/bin/ruff"
] The error message:
Seems like predefined variables are expanded, but not the environment variables. |
I have a similar problem: "ruff.format.args": [
"--config",
"~/AppData/Roaming/Code/User/pyproject.toml",
], This worked fine until
|
Yeah, we're failing to expand things there. I will fix now. |
Fix here: astral-sh/ruff#10219 |
## Summary When users provide configurations via `--config`, we use `shellexpand` to ensure that we expand signifiers like `~` and environment variables. In #9599, we modified `--config` to accept either a path or an arbitrary setting. However, the detection (to determine whether the value is a path or a setting) was lacking the `shellexpand` behavior -- it was downstream. So we were always treating paths like `~/ruff.toml` as values, not paths. Closes astral-sh/ruff-vscode#413.
## Summary When users provide configurations via `--config`, we use `shellexpand` to ensure that we expand signifiers like `~` and environment variables. In astral-sh#9599, we modified `--config` to accept either a path or an arbitrary setting. However, the detection (to determine whether the value is a path or a setting) was lacking the `shellexpand` behavior -- it was downstream. So we were always treating paths like `~/ruff.toml` as values, not paths. Closes astral-sh/ruff-vscode#413.
Environment
Ruff: v2024.12.0
VSCode: 1.86.2 (Universal)
OS: Mac Os 14.3
Description
Here is the error message.
This path value used to be fine, but it seems to be invalid after the most recent update to Ruff or VSCode.
Thanks!
The text was updated successfully, but these errors were encountered: