astral-sh / astral-sh/ruff

Make `Range` and `SourceFile` optional in `Diagnostic` and `Message`

Open
#4,571 5 comments 1 reaction 1 assignee Claimed by @ntBre View on GitHub
diagnostics internal
Dominant language
Rust
Stars
49.6k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
445

Description

There are some cases where we can't produce a relevant span or may not be able to read the source into a string, e.g. [`toml` sometimes doesn't emit spans](https://github.com/charliermarsh/ruff/pull/4496/files#r1198653173), `IOError` or files larger than 4GB. We should therefore make `Range` and `SourceFile` optional in `Diagnostic` and `Message`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.