Skip to content

[unstable option] group_imports #5083

@karyon

Description

@karyon
Contributor

Tracking issue for unstable option: group_imports.

See Processes.md, "Stabilising an Option":

  • Is the default value correct?
    The design and implementation of the option are sound and clean.
    The option is well tested, both in unit tests and, optimally, in real usage.
    There is no open bug about the option that prevents its use.

Sub-issues

Sub-issues

0 of 1 Issues completed

Activity

changed the title [-][unstable option] `merge_imports`[/-] [+][unstable option] `imports_granularity`[/+] on Nov 14, 2021
changed the title [-][unstable option] `imports_granularity`[/-] [+][unstable option] `group_imports`[/+] on Nov 14, 2021
stjepangolemac

stjepangolemac commented on Feb 10, 2022

@stjepangolemac

Would it be possible to add a fourth group for the workspace members? They're technically external crates but still different from 3rd party crates. Something like StdExternalWorkspaceCrate.

(let me know if this isn't the right place to discuss this)

calebcartwright

calebcartwright commented on Feb 11, 2022

@calebcartwright
Member

No worries @stjepangolemac fine to ask here (and probably worth having pointers to various issues anyway). In short, we're limited by the information that's actually available. More detailed in the issues linked below

rust-lang/style-team#131 (comment)
#4693
#4709

ShadowJonathan

ShadowJonathan commented on Feb 18, 2022

@ShadowJonathan

What's preventing the option from stablising as-is? #4693 to me seems to be about the addition of an extra option, but is there any problem with the current options? Any real bugs?

daboross

daboross commented on Feb 19, 2022

@daboross
Contributor

#4709 seems like a fairly big bug to me. Besides that, did we actually decide that this was the only sane ordering? I'm pretty sure it was waiting on having a few different options for grouping imports before stabilizing, if it is ever going to stabilize.

calebcartwright

calebcartwright commented on Feb 19, 2022

@calebcartwright
Member

I appreciate the interest and willingness of folks to participate in discussions, but should you choose to do so, a gentle reminder to be sure to thoroughly read the thread and linked material.

The process for stabilizing an option is both linked, and enumerated with checkboxes, in the issue description. None of those enumerated requirements can be cleared yet, including the fact that yes there's indeed real bugs that are either directly linked or transitively linked from issues/discussions that are directly linked. One can also search open issues to find additional related issues that aren't directly linked.

To again echo inline:

SimonSapin

SimonSapin commented on Jun 24, 2022

@SimonSapin

I’d like for this option to have another value named Visibility that makes one group for use example;, one for pub(crate) use example; and another for pub use example;. (I’m less sure of the groups’ order.)

This is to separate private imports (that are only there for convenience of naming things inside a module’s code) from reexports that affect the public API of a module or crate.

calebcartwright

calebcartwright commented on Jul 8, 2022

@calebcartwright
Member

Seems I forgot to hit the "comment" button the other day, but yes @SimonSapin that type of grouping and variant should be possible with the information available to rustfmt.

However, I think it would be best to pull this additional-variant request out so it can be tracked as a separate feature requests, both for work tracking/implementation purposes and because it's not necessary for stabilization of the option nor related to it (we have the ability to add new, unstable variants to already stable options)

39 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    unstable optiontracking issue of an unstable option

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jonhoo@SimonSapin@RalfJung@daboross@jaskij

        Issue actions

          [unstable option] `group_imports` · Issue #5083 · rust-lang/rustfmt