-
Notifications
You must be signed in to change notification settings - Fork 1k
Newline style changes to Unix-style when file is modified #4097
Copy link
Copy link
Labels
1x-backport:pendingFixed/resolved in source but not yet backported to a 1x branch and releaseFixed/resolved in source but not yet backported to a 1x branch and release
Milestone
Description
On Windows, using the default newline style (either without rustfmt.toml or by explicitly setting newline_style="Auto":
- leaves the newlines intact if the file does not have any formatting issues (ok, expected)
- saves modified files with Unix-style endings, even when all line-breaks in the input file are CRLF.
I would expect that in such cases the "Auto" value would use the line-break style inferred from examining the file.
Version used: rustfmt 1.4.11-stable (9eb4b564 2020-01-29)
as invoked via the cargo fmt command, version cargo 1.42.0 (86334295e 2020-01-31)
It's possible to work around this by forcing "Native" style in the rustfmt.toml but the default behaviour results in a mixture of line-ending styles throughout the project and triggers git line-ending conversion warnings.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
1x-backport:pendingFixed/resolved in source but not yet backported to a 1x branch and releaseFixed/resolved in source but not yet backported to a 1x branch and release
Type
Fields
Give feedbackNo fields configured for issues without a type.