Add better line break issue handling.#295
Open
woodhull wants to merge 5 commits intoData-Liberation-Front:mainfrom
Open
Add better line break issue handling.#295woodhull wants to merge 5 commits intoData-Liberation-Front:mainfrom
woodhull wants to merge 5 commits intoData-Liberation-Front:mainfrom
Conversation
Member
|
Thanks! We'll check it over :) |
Member
|
It looks fine, we could just do with adding tests for it before merging in. Do you have any sample data that causes the failures? |
D-system
reviewed
Nov 7, 2024
lib/csvlint/validate.rb
Outdated
Comment on lines
402
to
408
| if message.match(/^Unquoted fields do not allow new line/i) | ||
| return :line_breaks | ||
| end | ||
|
|
||
| if message.match(/^New line must be/i) | ||
| return :inconsistent_line_breaks | ||
| end |
Contributor
There was a problem hiding this comment.
If I read the linter correctly .match does not return a boolean therefore it is creating a object for nothing.
To fix it, we should use .match?.
Suggested change
| if message.match(/^Unquoted fields do not allow new line/i) | |
| return :line_breaks | |
| end | |
| if message.match(/^New line must be/i) | |
| return :inconsistent_line_breaks | |
| end | |
| if message.match?(/^Unquoted fields do not allow new line/i) | |
| return :line_breaks | |
| end | |
| if message.match?(/^New line must be/i) | |
| return :inconsistent_line_breaks | |
| end |
D-system
reviewed
Jan 14, 2025
| spec.require_paths = ["lib"] | ||
|
|
||
| spec.required_ruby_version = [">= 2.5", "< 3.4"] | ||
| spec.required_ruby_version = [">= 2.5", "< 3.5"] |
Contributor
There was a problem hiding this comment.
Please create another PR for this change.
It is out of scope.
Member
There was a problem hiding this comment.
No need for another PR, there's already one open to make that change, but it's waiting on a bugfix for cucumber.
Member
There was a problem hiding this comment.
I've merged that now, might be able to just rebase this.
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.
It's probably best to treat this as a feature request / bug report rather than a traditional PR.
We ran into a couple of validation issues that were coded as
unknown_errorwhen they were better understood with a more specific error type in customer provided CSVs.This adds better error classification for those cases, and allows us to move forward but we do not understand enough of the overall structure of the program or how to add good specs for this behavior. We're just moving fast and sharing this code in the hope that knowing someone might need better classification in this case is helpful to you upstream.
Thank you for your work, and sorry we're not able to put together a better PR at this time. I did not quite understand how this method is supposed to work.