Commit 47cae93
Emit end line/column in JSON format for span tracking (#20734)
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
Co-authored-by: Adam Turner <turner@hudson-trading.com>1 parent ab5fe7f commit 47cae93
File tree
4 files changed
+25
-8
lines changed- mypy
- test-data/unit
4 files changed
+25
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1480 | 1480 | | |
1481 | 1481 | | |
1482 | 1482 | | |
| 1483 | + | |
| 1484 | + | |
1483 | 1485 | | |
1484 | 1486 | | |
1485 | 1487 | | |
1486 | 1488 | | |
1487 | 1489 | | |
1488 | 1490 | | |
1489 | 1491 | | |
| 1492 | + | |
| 1493 | + | |
1490 | 1494 | | |
1491 | 1495 | | |
1492 | 1496 | | |
| |||
1502 | 1506 | | |
1503 | 1507 | | |
1504 | 1508 | | |
1505 | | - | |
| 1509 | + | |
1506 | 1510 | | |
1507 | 1511 | | |
1508 | 1512 | | |
| |||
1512 | 1516 | | |
1513 | 1517 | | |
1514 | 1518 | | |
1515 | | - | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
1516 | 1529 | | |
1517 | 1530 | | |
1518 | 1531 | | |
1519 | 1532 | | |
1520 | 1533 | | |
1521 | 1534 | | |
1522 | | - | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
1523 | 1538 | | |
1524 | 1539 | | |
1525 | 1540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7655 | 7655 | | |
7656 | 7656 | | |
7657 | 7657 | | |
7658 | | - | |
| 7658 | + | |
7659 | 7659 | | |
7660 | 7660 | | |
7661 | 7661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments