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

feat: Update statement checker to use new diagnostics #621

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

mark-koch
Copy link
Collaborator

Closes #540

@mark-koch mark-koch requested a review from a team as a code owner November 5, 2024 12:02
@mark-koch mark-koch requested review from qartik and removed request for a team November 5, 2024 12:02
@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.20%. Comparing base (08af12c) to head (0fbaf77).

Files with missing lines Patch % Lines
guppylang/checker/stmt_checker.py 85.71% 2 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           feat/diagnostics     #621      +/-   ##
====================================================
+ Coverage             92.18%   92.20%   +0.02%     
====================================================
  Files                    65       64       -1     
  Lines                  7201     7060     -141     
====================================================
- Hits                   6638     6510     -128     
+ Misses                  563      550      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@qartik qartik left a comment

Choose a reason for hiding this comment

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

The error messages look way more friendly now! Had a question about one of them. Unsure if it's even part of this PR.

13 | @guppy(module)
14 | def foo(s: MyStruct) -> None:
15 | s.z = 2
| ^ Attribute `z` not found on type `int`
Copy link
Member

Choose a reason for hiding this comment

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

Would it be an easier read if this error was:

Suggested change
| ^ Attribute `z` not found on type `int`
| ^ Attribute `z` of type `int` not found

or even better

Suggested change
| ^ Attribute `z` not found on type `int`
| ^ `MyStruct` has no attribute `z` of type `int`

I actually don't see the relevance of the inferred type here, the error message on the left is quite descriptive as is. Perhaps I am missing some context here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops yes it's supposed to say "MyStruct" instead of "int" 👍

@mark-koch mark-koch requested a review from qartik November 5, 2024 14:15
@mark-koch mark-koch merged commit cbe0830 into feat/diagnostics Nov 5, 2024
2 checks passed
@mark-koch mark-koch deleted the diag/stmt-checker branch November 5, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants