More advanced `group_imports` with 4 groups and adaptable "std-like" crates
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
In code i write i have taken to group the import statements into 4 groups:
- "std-like" crates which include all the normal std crates (
std,alloc,core) and large crates liketokioor frameworks likeaxumorbevypretty much everything which fundamentaly controls how my code will look like. - Other external crates
- Workspace internal crates
- Crate internal imports
I have thought about trying to implement this in rustfmt, but i don't know how doable this is.
I guess making crates in 1. optionally configurable shouldn't be that hard, but does rustfmt get any workspace information? Is it feasible to optionally implement retrieving workspace information for such a feature, or would this require some larger architectural/conceptual change?
Thanks in advance :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining rustfmt's existing import-grouping configuration and determine whether it has access to workspace information. Then assess how configurable "std-like" crates and four import groups would fit the formatter's architecture. Done means establishing whether the feature is feasible and defining its required configuration and workspace behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100