-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
bugUnexpected and reproducible misbehavior.Unexpected and reproducible misbehavior.
Description
Bug Description
The rewritten sorted_imports rule doesn't correctly distinguish import groups that also contain comments. Leading comments stay with the import node they're associated with, but I'd expect that to break on newlines.
Bad correction I get when I expected the original code not to trigger a violation:
+// comment for second group
+import AAA
//
// Copyright © Foo
//
import DDD
import FFF
-
-// comment for second group
-import AAA
import BBB
import CCCRelated example where the correction is placed above the first item's trivia when I would expect it to split on the new line:
+import AAA
//
// Copyright © Foo
//
import class BBB.View
-import AAAEnvironment
- SwiftLint 0.62.1
- Xcode 26.0.1
- installed from source
Metadata
Metadata
Assignees
Labels
bugUnexpected and reproducible misbehavior.Unexpected and reproducible misbehavior.