Thanks to visit codestin.com
Credit goes to github.com

Skip to content

stubtest: More information in concise errors #15011

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

Open
QuLogic opened this issue Apr 6, 2023 · 0 comments
Open

stubtest: More information in concise errors #15011

QuLogic opened this issue Apr 6, 2023 · 0 comments

Comments

@QuLogic
Copy link

QuLogic commented Apr 6, 2023

Feature

The default error message is 5 lines:

  1. An error message
  2. Stub file/line context information
  3. Stub line contents
  4. Runtime file/line context information
  5. Runtime line contents

The concise error message is 1 line, but all it contains is the first point above.

Instead, it would be nice if it included context information, i.e., printing something like file:line:error message. Extra nice would be if it printed the message twice, once for stub and once for runtime (unless the error was that one was missing of course.)

Also, the note about unused allowlist entry includes no context information in either mode, but it would be nice if it did.

Pitch

In matplotlib/matplotlib#25586, I am trying to get stubtest errors posted to PRs. Because the concise format contains no context information, I must use the verbose messages, but as those are multiple lines, it is difficult to easily parse those. In my test PR, you can see that I am able to catch 4 out of 6 errors. I cannot catch the allowlist notes because they include no context information. I cannot catch a missing stub entry because that error message includes no line number.

As you can see, I need to create a setup for each of the 5 lines. If the concise errors included context information, I could simplify that to just %f:%l:%m or similar.

Theoretically, this could also be useful for any editor that supported vim's errorformat.

Also cc'ing @hauntsaninja from matplotlib/matplotlib#24976 (comment)

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

No branches or pull requests

2 participants