Handling tags with empty values#63
Closed
holub008 wants to merge 2 commits intoMrTango:mainfrom
Closed
Conversation
shapiromatron
approved these changes
Apr 11, 2025
Collaborator
There was a problem hiding this comment.
This looks great and seems like a valuation addition if Embase can sometimes strip that space from blank lines. It looks like the implementation for this will change when we merge in #66, but the tests have been migrated over to that PR (link) so that we know that this change will be included in that one too.
Nice work, may apologies for the molasses-speed review!
Contributor
Author
|
Not a problem, thank you & glad the suggestion and test were useful! |
shapiromatron
pushed a commit
that referenced
this pull request
May 22, 2025
* Revert strip UTF-8 BOM strip * Improve performance and API of rispy parser * Fix test * Fix doctest * Add test from PR #63 * Happy lint * Remove BaseParser in favor of RisParser There is no need for a Baseparser. This lib is on parsing RIS, so the RisParser should be leading. * Deprecate get_tag and get_content in favor of parse_line * Refactor, no changes * Add test that tests multiple multiline formats * Add support for more complex multiline RIS tags * Happy lint * Add changes as suggested by Peter * Fix other issue discussed by Peter * Add more challenges to multiline test * Add type annotation * Fix failing type annotation for Python 3.8
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.
Resolves: #62
Implementation: By making the space after a tag optional in the line
PATTERN, content of''will be extracted for the line, rather than failing to match the line pattern and concatenating the entire line to the current tag's content.Testing: In addition to the test cases, I ran this change against my company's internal test suite for file import and saw no regression. Linter passes.