Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubtest: Link directly to line #14437

Merged
merged 4 commits into from Feb 18, 2023
Merged

Stubtest: Link directly to line #14437

merged 4 commits into from Feb 18, 2023

Conversation

Avasam
Copy link
Sponsor Contributor

@Avasam Avasam commented Jan 12, 2023

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
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
Copy link
Sponsor Contributor Author

Avasam commented Jan 23, 2023

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.

None yet

4 participants