Skip to content

Feature: Configure sectioning of orderedImports #1128

@amja

Description

@amja

Right now, enabling the orderedImports rule will put different types of imports (@testable, @_implementationOnly, etc.) in their own sections, separated by blank lines.

Would people be opposed if I raised a PR to add a configuration option to disable the sectioning behaviour? Just wanted to get some sense this would be supported by reviewers :)

My personal rationale: there are lots of testing scenarios where a list of imports will have one @testable import for the module under test and all others as normal imports. In those cases, I thought it seemed like overkill to put the 1 import in its own section. If we don't want to be too prescriptive in swift-format, it might be nice to offer the option.

Just let me know if people would be happy with this and I'll work on a PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions