ty icon indicating copy to clipboard operation
ty copied to clipboard

Add `--statistics` for an overview (like ruff)

Open Julian-J-S opened this issue 6 months ago • 2 comments

ruff has: ruff check --statistics which can be very useful.

I would love to see the same for ty.

Integration ruff / ty into a big repo and getting 10k+ "errors" is hard to manage. Getting some idea of how many different problems and counts would be very helpful :)

Julian-J-S avatar Jun 20 '25 10:06 Julian-J-S

Not exactly what you want, but something that you can use as a workaround in the meantime:

The ecosystem-analyzer program can parse ty's "concise" diagnostic output. You can use the parse-diagnostics subcommand to create structured diagnostic information, and then use generate-report to create a single HTML page overview of all diagnostics. This includes statistics (somewhat hidden in the filter-dropdowns), and allows you to browse different categories of errors easily:

alias ecosystem-analyzer='uvx --from "git+https://github.com/astral-sh/ecosystem-analyzer" ecosystem-analyzer'

uvx ty check --output-format=concise | ecosystem-analyzer parse-diagnostics
ecosystem-analyzer generate-report parsed-diagnostics.json 

If you supply --project-location and --commit to parse-diagnostics, you'll also get clickable GitHub links to the source code locations.

sharkdp avatar Jun 20 '25 13:06 sharkdp

I would also love to see it.

spaceone avatar Dec 18 '25 10:12 spaceone