Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Use new IntelliJ import order (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondra Pelech authored Dec 28, 2020
1 parent b263031 commit 869e427
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 23 deletions.
5 changes: 2 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ OrganizeImports {
expandRelative = false
groupExplicitlyImportedImplicitsSeparately = false
groupedImports = Explode
groups = ["re:javax?\\.", "scala.", "*"]
groups = ["*", "re:(javax?|scala)\\."]
importSelectorsOrder = Ascii
importsOrder = Ascii
removeUnused = true
Expand Down Expand Up @@ -673,9 +673,8 @@ OrganizeImports.groups = ["re:javax?\\.", "scala."]
[source,hocon]
----
[
"re:javax?\\."
"scala."
"*"
"re:(javax?|scala)\\."
]
----

Expand Down
6 changes: 3 additions & 3 deletions output/src/main/scala/fix/ExpandRelativeRootPackage.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package fix

import scala.util.control
import scala.util.control.NonFatal

import _root_.scala.collection.mutable.ArrayBuffer
import _root_.scala.util

import scala.util.control
import scala.util.control.NonFatal

object ExpandRelativeRootPackage
4 changes: 2 additions & 2 deletions output/src/main/scala/fix/ExplicitlyImportedImplicits.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package fix

import scala.concurrent.ExecutionContext

import fix.Implicits.a.nonImplicit
import fix.Implicits.b._

import scala.concurrent.ExecutionContext

import ExecutionContext.Implicits.global
import fix.Implicits.a.intImplicit
import fix.Implicits.a.stringImplicit
Expand Down
1 change: 0 additions & 1 deletion output/src/main/scala/fix/GlobalImportsOnly.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package fix

import java.sql.DriverManager
import java.time.Clock

import scala.collection.mutable
import scala.concurrent.duration.Duration

Expand Down
8 changes: 4 additions & 4 deletions output/src/main/scala/fix/ImportsOrderKeep.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package fix

import fix.QuotedIdent.`a.b`.`{ d }`.e
import fix.QuotedIdent._
import fix.QuotedIdent.`a.b`.{c => _, _}

import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.duration
import scala.concurrent._
import scala.concurrent.{Promise, Future}

import fix.QuotedIdent.`a.b`.`{ d }`.e
import fix.QuotedIdent._
import fix.QuotedIdent.`a.b`.{c => _, _}

object ImportsOrderKeep
8 changes: 4 additions & 4 deletions output/src/main/scala/fix/ImportsOrderSymbolsFirst.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package fix

import fix.QuotedIdent._
import fix.QuotedIdent.`a.b`.{c => _, _}
import fix.QuotedIdent.`a.b`.`{ d }`.e

import scala.concurrent._
import scala.concurrent.{Promise, Future}
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.duration

import fix.QuotedIdent._
import fix.QuotedIdent.`a.b`.{c => _, _}
import fix.QuotedIdent.`a.b`.`{ d }`.e

object ImportsOrderSymbolsFirst
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package fix {
package nested {
import sun.misc.BASE64Encoder

import java.time.Clock
import javax.annotation.Generated

import scala.collection.JavaConverters._
import scala.concurrent.ExecutionContext

import sun.misc.BASE64Encoder

object NestedPackageWithBraces
}
}
5 changes: 2 additions & 3 deletions rules/src/main/scala/fix/OrganizeImportsConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ final case class OrganizeImportsConfig(
groupExplicitlyImportedImplicitsSeparately: Boolean = false,
groupedImports: GroupedImports = GroupedImports.Explode,
groups: Seq[String] = Seq(
"re:javax?\\.",
"scala.",
"*"
"*",
"re:(javax?|scala)\\."
),
importSelectorsOrder: ImportSelectorsOrder = ImportSelectorsOrder.Ascii,
importsOrder: ImportsOrder = ImportsOrder.Ascii,
Expand Down

0 comments on commit 869e427

Please sign in to comment.