ty icon indicating copy to clipboard operation
ty copied to clipboard

Crippled reveal_type output for --output-format=gitlab/github

Open abelcheung opened this issue 4 weeks ago • 1 comments

Summary

reveal_type output works when --output-format is set to full or concise, but not for github or gitlab. Here is a minimal example:

from typing import reveal_type

x = "str".lower()
reveal_type(1)
reveal_type(x)

Concise output produces:

ty check --python-version 3.11 --output-format concise test.py
test.py:4:13: info[revealed-type] Revealed type: `Literal[1]`
test.py:5:13: info[revealed-type] Revealed type: `LiteralString`
Found 2 diagnostics

However the type is chopped off from github or gitlab result. For example, this is the output of github output format:

ty check --python-version 3.11 --output-format github test.py
::notice title=ty (revealed-type),file=[redacted]]\test.py,line=4,col=13,endLine=4,endColumn=14::test.py:4:13: revealed-type: Revealed type
::notice title=ty (revealed-type),file=[redacted]\test.py,line=5,col=13,endLine=5,endColumn=14::test.py:5:13: revealed-type: Revealed type

Version

ty 0.0.5 (d37b7dbd9 2025-12-20)

abelcheung avatar Dec 23 '25 15:12 abelcheung

Ah the GitHub and GitLab formats use Diagnostic::body, while concise uses Diagnostic::concise_message. It doesn't seem to break any Ruff tests to switch them to concise_message, so that might do the trick!

ntBre avatar Dec 23 '25 15:12 ntBre