(
self,
msg: str | ErrorMessage,
ctx: Context,
serious: bool = False,
*,
code: ErrorCode | None = None,
blocker: bool = False,
)
| 7659 | return True |
| 7660 | |
| 7661 | def fail( |
| 7662 | self, |
| 7663 | msg: str | ErrorMessage, |
| 7664 | ctx: Context, |
| 7665 | serious: bool = False, |
| 7666 | *, |
| 7667 | code: ErrorCode | None = None, |
| 7668 | blocker: bool = False, |
| 7669 | ) -> None: |
| 7670 | if not serious and not self.in_checked_function(): |
| 7671 | return |
| 7672 | # In case it's a bug and we don't really have context |
| 7673 | assert ctx is not None, msg |
| 7674 | if isinstance(msg, ErrorMessage): |
| 7675 | if code is None: |
| 7676 | code = msg.code |
| 7677 | msg = msg.value |
| 7678 | self.errors.report( |
| 7679 | ctx.line, |
| 7680 | ctx.column, |
| 7681 | msg, |
| 7682 | blocker=blocker, |
| 7683 | code=code, |
| 7684 | end_line=ctx.end_line, |
| 7685 | end_column=ctx.end_column, |
| 7686 | ) |
| 7687 | |
| 7688 | def note(self, msg: str, ctx: Context, code: ErrorCode | None = None) -> None: |
| 7689 | if not self.in_checked_function(): |
no test coverage detected