Import formatting in code
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
There is currently no import formatting rules in the codebase; adding import formatting could improve code maintainability, reducing the potential conflicts between contributions, as well improving code esthetics (for what it's worth, I know that this point is quite subjective).
rustfmt support import formatting, but the configurations options are still unstable. There are mainly two options: import granularity and group imports.
Also, contrary to other Rust component, it's possible to use unstable rustfmt options, but only using CLI, so formatting imports can be on stable Rust using for example --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate".
The downside of enabling import formatting is that it requires for contributors to setup their development environment with these options, or face a red CI. Adding a pre-commit hook can greatly help for that, and the fact that stable Rust can be used, so it doesn't requires contributor to download nightly Rust, makes the pre-commit hook worth considering.
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 reviewing the repository's current Rust formatting and CI setup, then evaluate the rustfmt imports_granularity and group_imports options described in the issue. Decide how formatting would be applied for contributors, including whether a pre-commit hook is appropriate; done means the project has an agreed, reproducible import-formatting workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ci-cd, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100