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

Cross-platform newlines for --check #85

Open
bjones1 opened this issue Dec 27, 2024 · 1 comment
Open

Cross-platform newlines for --check #85

bjones1 opened this issue Dec 27, 2024 · 1 comment

Comments

@bjones1
Copy link

bjones1 commented Dec 27, 2024

I'd like to run cargo sort --check on Windows/Linux/OS X in CI. However, I get failures on Windows, since cargo sort wants to rewrite the line endings to be an LF, instead of CRLF. I don't expect setting crlf = true in tomlfmt.toml to help, since that will cause failures on Linxus and OS X.

Would you consider a crlf setting which selects CRLF on Windows and LF on Linux/OS X? I think that would solve this problem.

@jplatte
Copy link
Collaborator

jplatte commented Feb 3, 2025

On the surface, this feature request makes sense to me. I see there's some windows-specific logic in fmt.rs already, but haven't grokked the whole thing. If you could write up a small summary of what's currently there and what you plan to change, I could better gauge whether I'd be interested in a PR (this project is quite low priority to me, and so I haven't spent the time to fully understand what's here already since taking over maintenance).

In terms of UI, I think this could be expressed as crlf = "native".

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

No branches or pull requests

2 participants