Repository navigation
feat: warn if unexpected-error-in-is_valid_syntax - #51
Conversation
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
|
@copilot add a new file that tests that the new warning is thorw. |
…thub.com:jkowalleck/rfc3987-syntax2 into feat/warn-if-unexpected-error-in-is_valid_syntax
Added
Added |
…ed-error-in-is_valid_syntax
There was a problem hiding this comment.
Pull request overview
This PR adds a warning path to the RFC3987 syntax validation helpers so consumers can distinguish between “invalid syntax” and “unexpected internal Lark error” scenarios.
Changes:
- Update
is_valid_syntax()to returnFalseforUnexpectedInputwithout warning, and warn+returnFalsefor otherLarkErrorsubclasses. - Add a regression test ensuring a
RuntimeWarningis emitted for non-UnexpectedInputLarkErrors. - Document the behavior change in the Unreleased changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_is_valid_syntax_warning.py | Adds test coverage for warning behavior on unexpected LarkError. |
| src/rfc3987_syntax2/syntax_helpers.py | Implements warning behavior for unexpected Lark errors; adjusts validator exception handling. |
| CHANGELOG.md | Notes the new warning behavior for is_valid_syntax(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Function
is_valid_syntaxissues a warning if an unexpected error occurred