+build Add sort imports support. (#28780)

* Add scalafix plugin for jdk 9.
* Add command alias sortImports.
* Excludes some sources from SortImports.
* Update SortImports to 0.4.0
* Sort imports with `sortImports` command.
This commit is contained in:
kerr 2020-04-27 20:32:18 +08:00 committed by GitHub
parent ea7205eaf7
commit 0e4d41ad33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1534 changed files with 7454 additions and 6165 deletions

View file

@ -0,0 +1,20 @@
/*
* Copyright (C) 2020 Lightbend Inc. <https://www.lightbend.com>
*/
package akka
import sbt.{AutoPlugin, PluginTrigger, Plugins, ScalafixSupport}
import scalafix.sbt.ScalafixPlugin
object ScalaFixExtraRulesPlugin extends AutoPlugin with ScalafixSupport{
override def trigger: PluginTrigger = allRequirements
override def requires: Plugins = ScalafixPlugin
import sbt._
import scalafix.sbt.ScalafixPlugin.autoImport.scalafixDependencies
override def projectSettings: Seq[Def.Setting[_]] = super.projectSettings ++ {
scalafixDependencies in ThisBuild += "com.nequissimus" %% "sort-imports" % "0.4.0"
}
}