toml-sort icon indicating copy to clipboard operation
toml-sort copied to clipboard

Newlines are always converted to platform default

Open viccie30 opened this issue 2 years ago • 0 comments

Because toml-sort does not explicitly pass a newline parameter to open() in cli.read_file() and cli.write_file(), Python defaults to universal newlines mode.

This means that formatted files always get LF line endings on most operating systems and CRLF line endings on MS Windows. Would it be possible to either keep the original newlines or add an option to force a specific line ending?

viccie30 avatar May 23 '23 07:05 viccie30