-
-
Notifications
You must be signed in to change notification settings - Fork 753
Handle CRLF and CR EOL in end-of-file-fixer #1163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Case is for file using CRLF endings
Added case for which the file has mixed line endings. In this case, default into using LF for end of file line.
This reverts commit 203735e.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like I said -- I don't think this is fixable without significantly regressing performance so I'd rather just say it's unsupported
perhaps instead we should back out any handling of \r
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will read the whole file into memory for \r
-delimited files -- and will read the whole file into memory if it has no newlines
Ok, I see your point.
What about leaving aside the detection logic and have an optional argument for choosing the desired EOL (defaulting to \n
)?
Second attempt :-)
Correctly adding last-line ending based on the one detected at the first line.
Basically fixes the behavior for CRLF and CR based files.