ruff/crates/ruff_db/src
Brent Westbrook 1ce65714c0
Move GitLab output rendering to `ruff_db` (#20117)
## Summary

This PR is a first step toward adding a GitLab output format to ty. It
converts the `GitlabEmitter` from `ruff_linter` to a `GitlabRenderer` in
`ruff_db` and updates its implementation to handle non-Ruff files and
diagnostics without primary spans. I tried to break up the changes here
so that they're easy to review commit-by-commit, or at least in groups
of commits:
- [preparatory changes in-place in `ruff_linter` and a `ruff_db`
skeleton](0761b73a61)
- [moving the code over with no implementation changes mixed
in](0761b73a61..8f909ea0bb)
- [tidying up the code now in
`ruff_db`](9f047c4f9f..e5e217fcd6)

This wasn't strictly necessary, but I also added some `Serialize`
structs instead of calling `json!` to make it a little clearer that we
weren't modifying the schema (e4c4bee35d).

I plan to follow this up with a separate PR exposing this output format
in the ty CLI, which should be quite straightforward.

## Test Plan

Existing tests, especially the two that show up in the diff as renamed
nearly without changes
2025-08-28 08:56:33 -04:00
..
diagnostic Move GitLab output rendering to `ruff_db` (#20117) 2025-08-28 08:56:33 -04:00
files [ty] Track heap usage of salsa structs (#19790) 2025-08-12 13:28:44 +02:00
system [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00
vendored Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
display.rs Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
file_revision.rs [ty] Track heap usage of salsa structs (#19790) 2025-08-12 13:28:44 +02:00
files.rs [ty] Speedup project file discovery (#19913) 2025-08-14 19:38:39 +01:00
lib.rs [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00
panic.rs [ty] Gracefully handle salsa cancellations and panics in background request handlers (#18254) 2025-05-26 13:37:49 +01:00
parsed.rs [ty] Shrink size of `AstNodeRef` (#20028) 2025-08-22 17:03:22 -04:00
source.rs [ty] Avoid overcounting shared memory usage (#19773) 2025-08-06 15:32:02 -04:00
system.rs [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00
testing.rs Update salsa past generational id change (#18362) 2025-05-30 15:31:33 +02:00
vendored.rs Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00