Skip to content
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

Enable organize-imports for mtags3 #2860

Merged
merged 1 commit into from
Jun 5, 2021
Merged
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
12 changes: 12 additions & 0 deletions .scalafix3.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rules = [
OrganizeImports
]

OrganizeImports.groupedImports = Explode
OrganizeImports.expandRelative = true
OrganizeImports.groups = [
"re:javax?\\."
"scala."
"scala.meta."
"*"
]
15 changes: 12 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ Global / onLoad ~= { old =>
old
}
Global / cancelable := true
Global / excludeLintKeys += scalafixConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this do?

Copy link
Member Author

Choose a reason for hiding this comment

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

sbt wrongly warns that scalafixConfig setting isn't used

Copy link
Member

Choose a reason for hiding this comment

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

I just opened scalacenter/sbt-scalafix#233 to avoid that

crossScalaVersions := Nil

addCommandAlias("scalafixAll", "all compile:scalafix test:scalafix")
Expand Down Expand Up @@ -274,7 +275,13 @@ val sharedSettings = List(
),
scalacOptions ++= crossSetting(
scalaVersion.value,
if3 = List("-language:implicitConversions", "-Xtarget:8", "-Xsemanticdb"),
if3 = List(
"-language:implicitConversions",
"-Xtarget:8",
"-Xsemanticdb",
// used only to supress validation error from scalafix-sbt
"-Ywarn-unused-import"
),
if211 = List("-Xexperimental", "-Ywarn-unused-import")
),
scalacOptions --= crossSetting(
Expand Down Expand Up @@ -378,10 +385,12 @@ lazy val mtags3 = project
moduleName := "mtags3",
scalaVersion := V.scala3,
target := (ThisBuild / baseDirectory).value / "mtags" / "target" / "target3",
publish / skip := true
publish / skip := true,
scalafixConfig := Some(
(ThisBuild / baseDirectory).value / ".scalafix3.conf"
)
)
.dependsOn(interfaces)
.disablePlugins(ScalafixPlugin)
.enablePlugins(BuildInfoPlugin)

lazy val mtags = project
Expand Down