feat(cli): add newline delimiter option and fix crlf behavior#1296
Merged
feat(cli): add newline delimiter option and fix crlf behavior#1296
Conversation
c439cb3 to
e426bda
Compare
Add a new `newline` delimiter option that automatically detects and matches either LF (\n) or CRLF (\r\n) line endings. Previously, the `crlf` option was incorrectly mapped to automatic newline detection. It now correctly matches only the literal CRLF sequence (\r\n). Users who relied on the old behavior should switch to the new `newline` option. BREAKING CHANGE: The `--delimiter=crlf` option now strictly matches the \r\n sequence instead of detecting both LF and CRLF. To migrate, replace `--delimiter=crlf` with `--delimiter=newline` or update the `HL_DELIMITER` environment variable from `crlf` to `newline`.
e426bda to
a5d6d19
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1296 +/- ##
=======================================
Coverage 88.08% 88.09%
=======================================
Files 67 67
Lines 11594 11598 +4
=======================================
+ Hits 10213 10217 +4
Misses 1381 1381 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Add a new
newlinedelimiter option and fix the incorrect behavior of thecrlfoption.Changes
--delimiter=newlineoption that automatically detects and matches either LF (\n) or CRLF (\r\n) line endings, whichever comes first--delimiter=crlfto correctly match only the literal CRLF sequence (\r\n) instead of performing automatic newline detectionThe
--delimiter=crlfoption now strictly matches the\r\nsequence instead of detecting both LF and CRLF.Migration
If you were using
--delimiter=crlfand relied on it matching both\nand\r\n:--delimiter=crlfwith--delimiter=newlineHL_DELIMITERenvironment variable fromcrlftonewlineDelimiter Options
autocr\r)lf\n)crlf\r\n)newlinelforcrlf, whichever comes firstnul\0)