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

Cargo.toml without trailing newlines is not considered sorted #43

Open
kartva opened this issue Jul 20, 2022 · 4 comments
Open

Cargo.toml without trailing newlines is not considered sorted #43

kartva opened this issue Jul 20, 2022 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kartva
Copy link

kartva commented Jul 20, 2022

[package]
name = "placeholder-name"
version = "0.1.0"
edition = "2021"
[dependencies]
axum = { path = "../../axum" }
hyper = { version = "0.14", features = ["full"] }
tokio = { version = "1", features = ["full"] }

is not considered sorted when running cargo sort --workspace --grouped --check, while the same snipped with a trailing newline is.

Version

Run with cargo-sort v1.0.7

@DevinR528
Copy link
Owner

Thanks for the report! Once my summer internship is over, I will finish moving to a new version of cargo_edit which should fix this issue and a few others. (This PR)

@DevinR528 DevinR528 added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Jul 23, 2022
@DevinR528
Copy link
Owner

Actually, after looking into this, I realized it will always fail on toml that doesn't have an ending newline (trailing newline, basically needs to end with \n). Would you want a feature to ignore whitespace?

@kartva
Copy link
Author

kartva commented Oct 7, 2022

If the spec allows no trailing newline, then yes, I believe it should work.

@DevinR528
Copy link
Owner

Fair point. This will be fixed eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants