Migrate to annotate-snippets
Open
Nobody has claimed this yet.
A-console-output
A-diagnostics
C-tracking-issue
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
annotate-snippets is a library version of rustc's diagnostic report renderer.
By migrating cargo to use it,
- we make them more consistent
- we have more features (coloring trailing notes/help, snippet rendering, etc)
- prepare for moving some of our diagnostics to be lints
Tasks
- #15928
- Clean up multi-line
Shell::notes- #15942
- #15943
- Migrate
Shell::noteto useprint_report(#15945) - Clean up multi-line or multi-part
Shell::warns (excludingutil/toml/mod.rswarnings)- #16035
- Somehow handle
util/toml/mod.rswarnings, either create a custom diagnostic type or move the warnings to a lint phase - Migrate
Shell::warnto useprint_report(#15917) - Switch
anyhow::Errorto a custom error type - Cleanup multi-line errors
- Migrate error rendering (
src/cargo/lib.rs) toprint_report(#15922)
Notes:
- We use https://rustc-dev-guide.rust-lang.org/diagnostics.html as our style guide
- Prefer
secondary_titleoverprimary_titlefor now. We can re-evaluate a switch toprimary_titlelater, see https://github.com/rust-lang/cargo/pull/16065#issuecomment-3378611734
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the remaining checklist items for Shell::warn, util/toml/mod.rs warnings, anyhow::Error, and error rendering in src/cargo/lib.rs. Read the Rust diagnostics style guide and existing print_report migrations first. Done means the remaining diagnostic paths are migrated consistently, with the listed warning and error cases handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100