You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on my previous PR I noticed that there's no rustfmt configuration regarding import grouping. (Or maybe there's another tool that I've missed?)
So I want to ask if it may be possible to adopt following rustfmt settings into rama:
In my PR I ended up reformatting key files with these settings to keep convenience of automatic import formatting and in the others I was editing them by hand to avoid unnecessary diffs, which was quite a chore.
Maybe I'm just lazy but still it's nice to offload such routine work to a tool 😄
I'm not advocating here for this specific style, but for a way to do it automatically/deterministically.
@soundofspace can you follow-up with @KoHcoJlb on this one. I have no strong opinion on it, but I seem to recall that you had a similar request not so long ago. I am fine with it as long as it doesn't make the life of new contributors harder for the little benefit it gives and as long as it is consistent, is auto fixed by running cargo fmt --workspace and fixes all import grouping at once I am ok with it... As I seem to recall it didn't go all the way? Perhaps these rules do? No clue.
Ah is that still nightly only? can you confirm? If so than yes this is ruled out and I will make it a blocker so someone can follow up once it is stable.
Controls how imports are structured in use statements. Imports will be merged or split to the configured level of granularity.
Similar to other import related configuration options, this option operates within the bounds of user-defined groups of imports. See group_imports for more information on import groups.
Note that rustfmt will not modify the granularity of imports containing comments if doing so could potentially lose or misplace said comments.
Default value: Preserve
Possible values: Preserve, Crate, Module, Item, One
Stable: No (tracking issue: #4991)
Sure, I understand @GlenDC.
Just want to clarify, is it a final ruling or is there some compromise that may be done?
Seems to me that rustfmt is moving rather slowly and these features can remain unstable for some time still.
no there is no compromise that can be done on this. I do not want to start getting into Go/Js land where people need to run custom tooling (I consider nightly custom) to run/contribute to rama. Especially for something like this.
Often things move slowly because no one cares enough to push it. As such do feel free to help get it pushed through and have it land in stable soon. They might not have anyone right now that cares enough to do so...
Activity
GlenDC commentedon Jun 2, 2026
@soundofspace can you follow-up with @KoHcoJlb on this one. I have no strong opinion on it, but I seem to recall that you had a similar request not so long ago. I am fine with it as long as it doesn't make the life of new contributors harder for the little benefit it gives and as long as it is consistent, is auto fixed by running
cargo fmt --workspaceand fixes all import grouping at once I am ok with it... As I seem to recall it didn't go all the way? Perhaps these rules do? No clue.soundofspace commentedon Jun 2, 2026
@KoHcoJlb dont think any of these are on stable yet? @GlenDC I guess we ruled out nightly for formatting or could we consider that?
GlenDC commentedon Jun 2, 2026
Ah is that still nightly only? can you confirm? If so than yes this is ruled out and I will make it a blocker so someone can follow up once it is stable.
soundofspace commentedon Jun 2, 2026
imports_granularity
Controls how imports are structured in use statements. Imports will be merged or split to the configured level of granularity.
Similar to other import related configuration options, this option operates within the bounds of user-defined groups of imports. See group_imports for more information on import groups.
Note that rustfmt will not modify the granularity of imports containing comments if doing so could potentially lose or misplace said comments.
Default value: Preserve
Possible values: Preserve, Crate, Module, Item, One
Stable: No (tracking issue: #4991)
GlenDC commentedon Jun 2, 2026
Ok that seals it.
@KoHcoJlb gonna close this until tracking issues are resolved on Rust's side.
KoHcoJlb commentedon Jun 2, 2026
Sure, I understand @GlenDC.
Just want to clarify, is it a final ruling or is there some compromise that may be done?
Seems to me that rustfmt is moving rather slowly and these features can remain unstable for some time still.
GlenDC commentedon Jun 2, 2026
no there is no compromise that can be done on this. I do not want to start getting into Go/Js land where people need to run custom tooling (I consider nightly custom) to run/contribute to rama. Especially for something like this.
Often things move slowly because no one cares enough to push it. As such do feel free to help get it pushed through and have it land in stable soon. They might not have anyone right now that cares enough to do so...