Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
rules = [OrganizeImports]
*/

package test.organizeImports

import z.Z // commentZ

import a.A

object InlineCommentMoves {
val keep = (null: AnyRef)
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
rules = [OrganizeImports]
*/

package test.organizeImports

import b.B // bnote

import a.A // anote

object InlineCommentMultiple {
val keep = 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we can remove that if removeUnused is not tested

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
rules = [OrganizeImports]
OrganizeImports.removeUnused = true
*/

package test.organizeImports

import my.pkg.K // noteK

import other.P

object InlineCommentRemoved {
val keep: P = null.asInstanceOf[P]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
rules = [OrganizeImports]
*/

package test.organizeImports

// This comment is ambiguous and not linked to a specific import
import y.Y
import x.X

object StandaloneComment {
val keep = new X
val alsoKeep = new Y
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package test.organizeImports

import a.A
import z.Z // commentZ

object InlineCommentMoves {
val keep = (null: AnyRef)
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package test.organizeImports

import a.A // anote
import b.B // bnote
import c.C

object InlineCommentMultiple {
val keep = 1
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package test.organizeImports

import other.P

object InlineCommentRemoved {
val keep: P = null.asInstanceOf[P]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package test.organizeImports

// This comment is ambiguous and not linked to a specific import
import x.X
import y.Y

object StandaloneComment {
val keep = new X
val alsoKeep = new Y
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package a {
class A
}

package b {
class B
}

package c {
class C
}

package z {
class Z
}

package my.pkg {
class K
}

package other {
class P
}

package x {
class X
}

package y {
class Y
}

Loading