Skip to content

Stubtest: Link directly to line - #14437

Merged
JelleZijlstra merged 4 commits into
python:masterfrom
Avasam:patch-1
Feb 18, 2023
Merged

JelleZijlstra merged 4 commits into
python:masterfrom
Avasam:patch-1

Conversation

@Avasam

@Avasam Avasam commented Jan 12, 2023 •

Copy link
Copy Markdown
Contributor

This format allows editors and terminals that support linking to specific lines in files to go directly to the right line.

Before:
image
image

After:
image
image

This format allows editors that support linking to specific lines in files to go directly to the right line.
@AlexWaygood

Copy link
Copy Markdown
Member

Looks like you'll need to update some bits of teststubtest.py, e.g.

mypy/mypy/test/teststubtest.py

Lines 1518 to 1525 in 77f8725

expected = (
f'error: {TEST_MODULE_NAME}.bad is inconsistent, stub argument "number" differs '
'from runtime argument "num"\n'
f"Stub: at line 1 in file {TEST_MODULE_NAME}.pyi\n"
"def (number: builtins.int, text: builtins.str)\n"
f"Runtime: at line 1 in file {TEST_MODULE_NAME}.py\ndef (num, text)\n\n"
"Found 1 error (checked 1 module)\n"
)

@Avasam

Avasam commented Jan 23, 2023

Copy link
Copy Markdown
Contributor Author

I didn't notice the failing CI. Thanks for letting me know. I actually went and searched through the entire codebase for any instance of "at line". And updated them (which includes docs).

I've also noticed that technically there could be a line number without a file, so I've updated for that case as well.

@Avasam Avasam mentioned this pull request Feb 18, 2023
@JelleZijlstra
JelleZijlstra merged commit c03e979 into python:master Feb 18, 2023
@Avasam
Avasam deleted the patch-1 branch February 18, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants