-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OrganizeImports: support Scala3 syntax as output
- Loading branch information
Showing
75 changed files
with
373 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
scalafix-tests/input/src/main/scala-2-xsource3/test/organizeImports/TargetDialectAuto.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
rules = [OrganizeImports] | ||
OrganizeImports { | ||
removeUnused = false | ||
targetDialect = Auto | ||
} | ||
*/ | ||
package test.organizeImports | ||
|
||
import scala.collection.immutable.{List => L} | ||
import scala.collection.mutable._ | ||
|
||
object TargetDialectAuto |
12 changes: 12 additions & 0 deletions
12
...t/src/main/scala-2/test/organizeImports/TargetDialectSingleImporteeStripCurlybraces.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
rules = [OrganizeImports] | ||
OrganizeImports.removeUnused = false | ||
OrganizeImports.targetDialect = Auto | ||
*/ | ||
package test.organizeImports | ||
|
||
import java.util.concurrent.{ BlockingDeque } | ||
import java.util.concurrent.{ConcurrentHashMap} | ||
import scala.collection.mutable.{_} | ||
|
||
object TargetDialectSingleImporteeStripCurlybraces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
scalafix-tests/input/src/main/scala-3/test/organizeImports/DeduplicateGivenImportees.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
scalafix-tests/input/src/main/scala-3/test/organizeImports/ExpandGiven.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
/* | ||
rules = [OrganizeImports] | ||
OrganizeImports.removeUnused = false | ||
OrganizeImports.targetDialect = Scala3 | ||
*/ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.GivenImports.Beta | ||
import test.organizeImports.GivenImports.Alpha | ||
import test.organizeImports.GivenImports.{given Beta, given Alpha} | ||
import test.organizeImports.GivenImports.{given Beta, given test.organizeImports.GivenImports.Gamma, given Alpha} | ||
import scala.util.Either | ||
|
||
object ExpandGiven |
1 change: 1 addition & 0 deletions
1
scalafix-tests/input/src/main/scala-3/test/organizeImports/ExpandUnimportGiven.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...tests/input/src/main/scala-3/test/organizeImports/MergeImportsFormatPreservingGiven.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
rules = [OrganizeImports] | ||
OrganizeImports.removeUnused = false | ||
OrganizeImports.groupedImports = Merge | ||
OrganizeImports.targetDialect = Scala3 | ||
*/ | ||
|
||
package test.organizeImports | ||
|
||
import test.organizeImports.GivenImports.* | ||
import test.organizeImports.GivenImports.{ given Alpha, given Beta } | ||
|
||
object MergeImportsFormatPreservingGiven |
11 changes: 11 additions & 0 deletions
11
scalafix-tests/input/src/main/scala-3/test/organizeImports/TargetDialectDowngrade.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
rules = [OrganizeImports] | ||
OrganizeImports.removeUnused = false | ||
OrganizeImports.targetDialect = Scala2 | ||
*/ | ||
package test.organizeImports | ||
|
||
import scala.util.Either as E | ||
import scala.util.Try as _ | ||
|
||
object TargetDialectDowngrade |
17 changes: 17 additions & 0 deletions
17
...t/src/main/scala-3/test/organizeImports/TargetDialectSingleImporteeStripCurlybraces.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
rules = [OrganizeImports] | ||
OrganizeImports.removeUnused = false | ||
OrganizeImports.targetDialect = Auto | ||
*/ | ||
package test.organizeImports | ||
|
||
import java.util.concurrent.{ BlockingDeque } | ||
import java.util.concurrent.{ConcurrentHashMap} | ||
import scala.collection.mutable.{*} | ||
import scala.collection.mutable.{ListMap as _} | ||
import scala.util.{ Try as T } | ||
|
||
import GivenImports.{given GivenImports.Alpha} | ||
import GivenImports.{given} | ||
|
||
object TargetDialectSingleImporteeStripCurlybraces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
scalafix-tests/input/src/main/scala/test/organizeImports/CurlyBracedSingleImportee.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
/* | ||
rules = [OrganizeImports] | ||
OrganizeImports.removeUnused = false | ||
OrganizeImports.targetDialect = Auto | ||
*/ | ||
package test.organizeImports | ||
|
||
import scala.collection.{Map} | ||
import scala.collection.{Seq => _} | ||
import scala.collection.{Set => ImmutableSet} | ||
|
||
object CurlyBracedSingleImportee |
Oops, something went wrong.