Skip to content

Add paths to toml parse errors#9358

Merged
charliermarsh merged 2 commits intomainfrom
paths-in-toml-path-errors
Jan 2, 2024
Merged

Add paths to toml parse errors#9358
charliermarsh merged 2 commits intomainfrom
paths-in-toml-path-errors

Conversation

@konstin
Copy link
Copy Markdown
Member

@konstin konstin commented Jan 2, 2024

Summary Previously, the information which toml file failed to parse was missing in errors.

Before

$ ruff check /home/konsti/projects/datasett
ruff failed
  Cause: TOML parse error at line 12, column 8
   |
12 | python "=3.9.2"
   |        ^
expected `.`, `=`

After

$ 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.

**Summary** Previously, the information which toml 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 `.`, `=`
```
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 2, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh merged commit a268648 into main Jan 2, 2024
@charliermarsh charliermarsh deleted the paths-in-toml-path-errors branch January 2, 2024 16:56
@charliermarsh charliermarsh added the cli Related to the command-line interface label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants