ruff/crates/ty/src
Brent Westbrook ac5488086f
[ty] Add GitHub output format (#20358)
## Summary

This PR wires up the GitHub output format moved to `ruff_db` in #20320
to the ty CLI.

It's a bit smaller than the GitLab version (#20155) because some of the
helpers were already in place, but I did factor out a few
`DisplayDiagnosticConfig` constructor calls in Ruff. I also exposed the
`GithubRenderer` and a wrapper `DisplayGithubDiagnostics` type because
we needed a way to configure the program name displayed in the GitHub
diagnostics. This was previously hard-coded to `Ruff`:

<img width="675" height="247" alt="image"
src="https://github.com/user-attachments/assets/592da860-d2f5-4abd-bc5a-66071d742509"
/>

Another option would be to drop the program name in the output format,
but I think it can be helpful in workflows with multiple programs
emitting annotations (such as Ruff and ty!)

## Test Plan

New CLI test, and a manual test with `--config 'terminal.output-format =
"github"'`
2025-09-17 09:50:25 -04:00
..
args.rs [ty] Add GitHub output format (#20358) 2025-09-17 09:50:25 -04:00
lib.rs [ty] Add GitLab output format (#20155) 2025-09-03 09:08:12 -04:00
logging.rs [ty] Allow `-qq` for silent output mode (#19366) 2025-07-15 17:08:19 +00:00
main.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
printer.rs [ty] clear the terminal screen in watch mode (#19712) 2025-08-04 13:45:37 +02:00
python_version.rs Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
version.rs Display `ty version` for `ty --version` and `ty -V` (#17888) 2025-05-06 08:06:41 -05:00