-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing OrganizeImports.targetDialect = Scala3
#1
base: OrganizeImports
Are you sure you want to change the base?
Conversation
OrganizeImports
DialectTarget=Scala3
OrganizeImports
DialectTarget = Scala3
OrganizeImports
DialectTarget = Scala3
OrganizeImports
targetDialect = Scala3
0e42fa0
to
b5d4f35
Compare
import dotty.tools.dotc.core.Phases.* | ||
import dotty.tools.dotc.core.Phases.Phase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order produced by the current public release of scalafix (.*
after .Phase
) comes from the fact that sorting was done using _
internally (Scala2 dialect). Indeed, .*
& ._
are not on the same side of .P
:
scala> Seq(".*","._",".a",".P",".{}"," ").sorted
val res4: Seq[String] = List(" ", .*, .P, ._, .a, .{})
I'd argue that it's better to keep alphanumerical tokens together (no matter their case), so that order of *
is accidentally better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output of this PR on these specific lines is consistent with scalafmt, for all rewrite.imports.sort
values, so having wildcards first seem to be the right thing to do.
version = 3.7.17
runner.dialect = Scala3
rewrite.rules = [Imports]
rewrite.imports.sort = ascii
rewrite.imports.groups = [
[".*"]
]
version = 3.7.17
runner.dialect = Scala3
rewrite.rules = [Imports]
rewrite.imports.sort = original
rewrite.imports.groups = [
[".*"]
]
version = 3.7.17
runner.dialect = Scala3
rewrite.rules = [Imports]
rewrite.imports.sort = scalastyle
rewrite.imports.groups = [
[".*"]
]
5aa2327
to
dc15ceb
Compare
dc15ceb
to
563e4d2
Compare
563e4d2
to
0acbed9
Compare
OrganizeImports
targetDialect = Scala3
OrganizeImports.targetDialect = Scala3
Testing scalacenter/scalafix#1896
See also #2 or https://github.com/bjaglin/dotty/compare/OrganizeImportsDialectTargetScala2..OrganizeImportsDialectTargetScala3