-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Move shell expansion into --config
lookup
#10219
Conversation
0c765a3
to
9212c42
Compare
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLC0415 | 7 | 0 | 7 | 0 | 0 |
PLR6201 | 1 | 0 | 1 | 0 | 0 |
9212c42
to
d462d66
Compare
Thanks for fixing -- sorry I missed this! |
d462d66
to
de7d227
Compare
} | ||
// Convert to UTF-8. | ||
let Some(value) = value.to_str() else { | ||
// But respect non-UTF-8 paths. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth adding a test with a non-UTF-8 path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna defer it, I don't even know if Ruff as a whole will work with non-UTF-8 paths.
de7d227
to
06f3006
Compare
## 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.
Summary
When users provide configurations via
--config
, we useshellexpand
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 theshellexpand
behavior -- it was downstream. So we were always treating paths like~/ruff.toml
as values, not paths.Closes astral-sh/ruff-vscode#413.