rust-lang / rust-lang/rustfmt

How should group_imports handle visibility?

Open
#6,861 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-discussion T-style UO-group_imports
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

  1. What should be the default behavior with how imports are grouped by visibility?
    1. Should pub items be sorted differently at all?
    2. Should pub(<visibility>) be sorted differently than pub?
    3. Sort by visibility then by name or just by name? What about pub(in a::b)?
    4. Should pub(<visibility>) cause more blank-line-separated groups? (e.g. a pub group and a pub(crate) group, etc.) or just one group for all pub items?
  2. What config options should be available?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named in the issue. First resolve the proposed visibility ordering, grouping, and configuration behavior, then identify the relevant rustfmt implementation and tests; the work is done when the decisions are implemented and covered by tests.

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
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.