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

Sort dependencies in Cargo.toml files #1988

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

samestep
Copy link
Contributor

Currently most of the [dependencies] lists in Cargo.toml files are close to sorted but not quite, making it a bit confusing to figure out where to insert a new dependency. This PR sorts them all.

Copy link
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should leave a comment at the top of these lists indicating they are sorted and to please respect the sort order on changes? On the other hand that seems noisy. I wish this was something cargo fmt did automatically.

@samestep
Copy link
Contributor Author

@pchickey I'm not sure; I was going to say it might not be too hard to add a Python script using tomllib to check in CI that all the dependencies are sorted, but then I remembered that the following cases wouldn't be completely trivial:

Still possible, though.

@pchickey
Copy link
Contributor

pchickey commented Jan 28, 2025

Yeah, I don't think we should invent nonstandard tooling here. Best effort is good enough. Most people will notice a well-sorted list and maintain it, and if they don't, not the end of the world.

@alexcrichton alexcrichton added this pull request to the merge queue Jan 28, 2025
Merged via the queue into bytecodealliance:main with commit 17220b6 Jan 28, 2025
30 checks passed
@samestep samestep deleted the sort-dependencies branch January 28, 2025 20:02
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

Successfully merging this pull request may close these issues.

3 participants