Skip to content
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

feat: support config line_separator #175

Merged
merged 1 commit into from
Apr 24, 2021

Conversation

SafeteeWoW
Copy link
Contributor

Add config "line_separator" which supports the following options

input: Determine line separator by the input content. This is the default.
os: Determine line separator by the operating system
lf: Use Unix Style ("\n")
cr: Use classic Max Style ("\r")
crlf: Use Windows Style ("\r\n")

Note that the default behavior is changed.
The previous behavior is "os",
but I think "input" is a more appropriate default.

Some potential issues:

  1. To avoid potential test issues by git autocrlf, I have modified .gitattributes to force all files to be checkouted in LF line separator.
  2. The new line separator behavior is not the same as the old behavior. The old behavior determines the output line separator by the operating system (by std::cout in text mode). The new behavior defaults to determine by the input content's line separator. I believe the new behavior is a better default.
  3. Have I added enough tests?
  4. Not sure if my clang-format is setup correctly. Code format may need to be fixed

Add config "line_separator" which supports the following options

input: Determine line separator by the input content. This is the default.
os: Determine line separator by the operating system
lf: Use Unix Style ("\n")
cr: Use classic Max Style ("\r")
crlf: Use Windows Style ("\r\n")

Note that the default behavior is changed.
The previous behavior is "os",
but I think "input" is a more appropriate default.
@Koihik Koihik merged commit abfe164 into Koihik:master Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants