Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Koch <[email protected]>
  • Loading branch information
ss2165 and mark-koch committed Jan 7, 2025
1 parent 6a608f0 commit da24409
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions guppylang/std/_internal/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,12 @@ class PanicChecker(CustomCallChecker):

@dataclass(frozen=True)
class NoMessageError(Error):
title: ClassVar[str] = "No panic message."
span_label: ClassVar[str] = "Missing message argument to panic call."
title: ClassVar[str] = "No panic message"
span_label: ClassVar[str] = "Missing message argument to panic call"

@dataclass(frozen=True)
class Suggestion(Note):
message: ClassVar[str] = 'add a message: `panic("message")`'
message: ClassVar[str] = 'Add a message: `panic("message")`'

def synthesize(self, args: list[ast.expr]) -> tuple[ast.expr, Type]:
match args:
Expand Down
6 changes: 3 additions & 3 deletions tests/error/misc_errors/panic_msg_empty.err
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Error: No panic message. (at $FILE:7:4)
Error: No panic message (at $FILE:7:4)
|
5 | @compile_guppy
6 | def foo(x: int) -> None:
7 | panic()
| ^^^^^^^ Missing message argument to panic call.
| ^^^^^^^ Missing message argument to panic call

Note: add a message: `panic("message")`
Note: Add a message: `panic("message")`

Guppy compilation failed due to 1 previous error

0 comments on commit da24409

Please sign in to comment.