Skip to content

Overzealous sortImport application. #2437

@oscamv-verkada

Description

@oscamv-verkada

We have, in our codebase, a few instances of the following:

@preconcurrency import class OldLibrary.EldritchHorror

/// Omitting a bunch of usual library imports.
import OldLibrary

In this instance, the order of the imports matters. We only want to skip all the Swift 6 concurrency and other checks for that class since it's an eldritch horror but the rest of the library has either gotten a cleanup or is not complex enough not to fix along the way if issues pop up.

Unfortunately swiftformat insists on reordering the imports to the point where the dedicated @preconcurrency import goes after the library one, causing compilation issues.

I'm unsure of what would be the best tool fix for this (we just added // swiftformat:ignore:this sortImports to the affected lines) but wanted to make sure you were aware of the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler bugAn issue caused by a bug in the Swift compiler

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions