mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
Add paths to toml parse errors (#9358)
**Summary** Previously, the information which toml file failed to parse was missing in errors. **Before** ```console $ ruff check /home/konsti/projects/datasett ruff failed Cause: TOML parse error at line 12, column 8 | 12 | python "=3.9.2" | ^ expected `.`, `=` ``` **After** ```console $ ruff check /home/konsti/projects/datasett ruff failed Cause: Failed to parse /home/konsti/projects/datasett/datasett-0.0.1.tar.gz/datasett-0.0.1/pyproject.toml Cause: TOML parse error at line 12, column 8 | 12 | python "=3.9.2" | ^ expected `.`, `=` ``` I avoided pulling in `fs_err` just for this case.
This commit is contained in:
parent
9073220887
commit
a268648c58
4 changed files with 16 additions and 9 deletions
|
@ -220,8 +220,7 @@ fn resolve_configuration(
|
|||
}
|
||||
|
||||
// Resolve the current path.
|
||||
let options = pyproject::load_options(&path)
|
||||
.map_err(|err| anyhow!("Failed to parse `{}`: {}", path.display(), err))?;
|
||||
let options = pyproject::load_options(&path)?;
|
||||
|
||||
let project_root = relativity.resolve(&path);
|
||||
let configuration = Configuration::from_options(options, &project_root)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue