Skip to content

[Feature Request] configure blank lines between related items #6803

@Aderinom

Description

@Aderinom

related to: #3382

I'd like to request an option to specify the amount of blank lines between related items.

Related items either share the same concrete Type:

  • struct A
  • enum A
  • impl A
  • impl<T> A
  • impl Trait for A

Or the same Trait type:

  • trait T
  • impl T for A

Formatting rule

  • Between items in the same group: N blank lines. (default to 0 or 1)
  • Between different groups: exactly M blank lines (typically 1).

Example normalization (N = 0, M = 1):

struct A;
impl A {
  //...
}

struct B;
impl B {
  //...
};

Example configuration could be

top_level_items_related_blank_lines = 0
top_level_items_unrelated_blank_lines = 1

Inferring macros would be out of scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageThis issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions