Repository navigation
Include the source filename in parse warnings - #758
Closed
kurunomochi wants to merge 1 commit into
Closed
kurunomochi wants to merge 1 commit into
kurunomochi wants to merge 1 commit into
Conversation
Author
|
Hi @theskumar, this PR is ready for review! All CI checks are passing and there are no merge conflicts. It adds the source filename to the parse warnings as requested in #483. Could you please take a look when you have time? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When several dotenv files are loaded, a warning such as "could not parse statement starting at line 2" gives no indication which file to inspect. This addresses the diagnostic requested in #483. It uses the name of the stream actually parsed, so a missing path passed alongside a fallback stream cannot be reported as the source. The same diagnostic is used during reads and rewrites. Anonymous streams retain the line-only message, and no dotenv contents are logged.
Tests cover a file with both a valid and an invalid binding, and an anonymous fallback stream. On Windows with Python 3.13 the suite passed (242 passed, 52 skipped). Ruff lint and format checks passed, as did mypy on src.
Prepared with OpenAI Codex.