-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Line endings not set #935
Comments
Ok, it seems that csharpier by default uses the I'd argue, csharpier should behave differently and pick one line ending as otherwise you still have different OSes with different line endings that might interfere and constantly change line endings from the one to the other. |
The current behavior is taken from prettier. Originally CSharpier exposed options for Auto, CRLF and LF, but that was removed early on. If CSharpier were to use only LF, I assume that would make some windows users unhappy, and vice versa. Another option would be to read the first file to determine which line ending to use, but if that first file changes, or if the first file is not always consistent then things could also flip back and forth. The advice we've followed at work is to get all of the line endings consistent, and then use a I'm not opposed to re-exposing the options for line endings, which would solve your problem and also allow people to easily do a one time cleanup before changing it back to auto. |
Ah, interesting, I did not know about the situation at prettierjs. Apparently, the current solution prettierjs uses is by default to enforce LF but a config option exists that can be set to For our team, re-exposing the existing option would solve our issue :) |
* Re-add support for line endings being configurable. closes #935 * Format file * Update Src/CSharpier.Cli/Options/CaseInsensitiveEnumConverter.cs Co-authored-by: Lasath Fernando <devel@lasath.org> --------- Co-authored-by: Lasath Fernando <devel@lasath.org>
It seems that running
dotnet-csharpier .
on our project folder does not do anything about line endings. Files that have "lf" line endings keep them, files that have "crlf" keep them, too.I'd expect that one of the two is chosen and applied.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: