Fix correction of sorted_imports rule for leading comments case#6318
Fix correction of sorted_imports rule for leading comments case#6318SimplyDanny merged 1 commit intomainfrom
sorted_imports rule for leading comments case#6318Conversation
|
I'm still getting some unexpected diffs with this change: //
// Copyright © Foo
//
+import AAA // a comment
import DDD
import FFF
-
-// some comment
-import AAA // a comment
import NNN
import RRR
import SSSand //
// Copyright © Foo
//
import DDD
-import SSS
// some comment
import FFF // a comment
+import SSS |
Generated by 🚫 Danger |
81395bb to
e448552
Compare
They should all be fine with the latest update. Are they, @jszumski? |
|
So close! just this one edge case left: +import BBB
//
// Copyright © Foo
//
import class CCC
-import BBB
import LLLI guess if the trivia of the old first item ends with a newline then a replacement into the first position should append to that old trivia? |
e448552 to
df404bb
Compare
Yeah, sort of that. 😅 The condition was too vague. The case of an empty line between the comment and the first imports wasn't decently handled. Could you give it another try? That really helps getting this properly sorted (pun indented). |
|
Also close, but if any replacement is made in a position >1 it chomps the first position's trivia: //
// Copyright © Foo
//
-
import AAA
-import class CCC2.View
import CCC1
+import class CCC2.View |
df404bb to
0b802f8
Compare
|
Next try ... |
|
Good day, when can we expect new release with this fix? |
It will be ready within the next few days. |
Fixes #6317.