Skip to content

Emit end line/column in JSON format for span tracking - #20734

Merged
ilevkivskyi merged 1 commit into
python:masterfrom
AA-Turner:json-span-info
Feb 4, 2026
Merged

ilevkivskyi merged 1 commit into
python:masterfrom
AA-Turner:json-span-info

Conversation

@AA-Turner

Copy link
Copy Markdown
Member

Recently, mypy gained the ability to output errors/notes as structured data in JSON format. This data, though, lacks the end_line and end_column information from mypy's ErrorTuple, which makes it harder to use for e.g. IDE integrations.

This is a fairly simple PR to just expose those fields in the JSON. I updated the constructor of MypyError to put the new arguments in the middle rather than at the end because I understand that this is an internal type, so we're free to make changes like this -- please correct me if I'm wrong here.

I just updated the existing tests rather than adding new ones, hopefully this is fine!

A

cc @JelleZijlstra as reviewer of #11396

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi ilevkivskyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, thanks!

@ilevkivskyi
ilevkivskyi merged commit 47cae93 into python:master Feb 4, 2026
22 checks passed
@AA-Turner
AA-Turner deleted the json-span-info branch February 4, 2026 14:31
@AA-Turner

Copy link
Copy Markdown
Member Author

Thanks @ilevkivskyi!

A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants