ty icon indicating copy to clipboard operation
ty copied to clipboard

Allow JSON as the output format

Open Khoyo opened this issue 6 months ago • 3 comments

The current allowed output formats of ty check are full and concise, which aren't great if you want to parse it (eg. in CI). Allowing the json and json-lines output formats that ruff already supports would make it easier.

Khoyo avatar Aug 20 '25 14:08 Khoyo

This is something that's on our mind.

It's unlikely that we'll port the json output 1:1. Instead, we might want to have multiple json outputs: a concise version similar to Ruff's output and a full output that captures more diagnostic information (maybe even in its rendered form).

So there's some design work that we need to do before exposing it to ty. This, otherwise, is very straightforward.

MichaReiser avatar Aug 20 '25 15:08 MichaReiser

Some more details in https://github.com/astral-sh/ty/issues/717

MichaReiser avatar Nov 14 '25 08:11 MichaReiser

For writing a linter --output-format json-lines would be nice. With gitlab output format I have all available options but must iterate a JSON list.

spaceone avatar Dec 19 '25 20:12 spaceone