Skip to content

Make import sorting order follow 2024 edition style #20423

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShoyuVanilla
Copy link
Member

@ShoyuVanilla ShoyuVanilla commented Aug 10, 2025

cc #20421

I've just copied version_sort from rustfmt and all the other things are just tedious things like test updates

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2025
} else {
// snake_case < UpperCamelCase < UPPER_SNAKE_CASE
let a_text = a_name.as_str();
let b_text = b_name.as_str();
Copy link
Member Author

@ShoyuVanilla ShoyuVanilla Aug 10, 2025

Choose a reason for hiding this comment

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

I've removed .trim_start_matches("r#")s here as it's only applied to Edition >= 2024
https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-raw-identifier-sorting.html

@ChayimFriedman2
Copy link
Contributor

I wonder whether it'll be better to just always sort like edition 2024 and let rustfmt do the work in other editions.

(Also AFAIK style editions are different from normal editions).

@ShoyuVanilla
Copy link
Member Author

ShoyuVanilla commented Aug 10, 2025

I wonder whether it'll be better to just always sort like edition 2024 and let rustfmt do the work in other editions.

(Also AFAIK style editions are different from normal editions).

Oh, you're right. I forgot that we might have different style_edition and edition 😅 With that just defaulting to 2024 edition and leaving the other editions to rustfmt as you suggest sounds most reasonable to me.

I'll revisit this tomorrow as it's bedtime in my timezone 💤

@ShoyuVanilla ShoyuVanilla changed the title Make import sort order edition-wise Make import sorting order follow 2024 edition style Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants