Skip to content

Commit

Permalink
Use Scalafix to clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
earldouglas committed Sep 21, 2024
1 parent 2df016c commit 16ea987
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 26 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
with:
java-version: 8
- run: sbt scalafmtCheckAll
- run: sbt "scalafixAll --check"
- run: sbt ^test
- run: sbt ^publishLocal
- run: sbt scripted
4 changes: 4 additions & 0 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rules = [
OrganizeImports
RemoveUnused
]
5 changes: 5 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ val awsJavaSdkVersion = "1.12.772"
libraryDependencies += "com.amazonaws" % "aws-java-sdk-elasticbeanstalk" % awsJavaSdkVersion
libraryDependencies += "com.amazonaws" % "aws-java-sdk-s3" % awsJavaSdkVersion

// Scalafix
semanticdbEnabled := true
semanticdbVersion := scalafixSemanticdb.revision
scalacOptions += "-Ywarn-unused-import"

// Publish to Sonatype, https://www.scala-sbt.org/release/docs/Using-Sonatype.html
credentials := List(
Credentials(Path.userHome / ".sbt" / "sonatype_credentials")
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
3 changes: 2 additions & 1 deletion src/main/scala-sbt-1.0/com/earldouglas/xwp/Compat.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.earldouglas.xwp

import sbt._
import sbt.Keys._
import sbt._
import sbt.internal.io.Source
import sbt.util.CacheStoreFactory

import FileInfo.Style
import WebappPlugin.autoImport.webappPrepare

Expand Down
8 changes: 5 additions & 3 deletions src/main/scala/com/earldouglas/xwp/ContainerPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.earldouglas.xwp

import java.util.concurrent.atomic.AtomicReference
import sbt._
import sbt.Def.taskKey
import sbt.Def.settingKey
import sbt.Def.taskKey
import sbt.Keys._
import sbt._

import java.util.concurrent.atomic.AtomicReference

import Compat.Process

object ContainerPlugin extends AutoPlugin {
Expand Down
13 changes: 6 additions & 7 deletions src/main/scala/com/earldouglas/xwp/ElasticBeanstalkDeploy.scala
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
package com.earldouglas.xwp

import com.amazonaws.auth.EnvironmentVariableCredentialsProvider
import com.amazonaws.regions.Regions
import com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalk
import com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClientBuilder
import com.amazonaws.services.elasticbeanstalk.model.CreateApplicationVersionRequest
import com.amazonaws.services.elasticbeanstalk.model.DeleteApplicationVersionRequest
import com.amazonaws.services.elasticbeanstalk.model.DescribeApplicationVersionsRequest
import com.amazonaws.services.elasticbeanstalk.model.EnvironmentTier
import com.amazonaws.services.elasticbeanstalk.model.S3Location
import com.amazonaws.services.elasticbeanstalk.model.UpdateEnvironmentRequest
import com.amazonaws.services.s3.AmazonS3
import com.amazonaws.services.s3.AmazonS3ClientBuilder
import java.io.File
import java.net.URLEncoder
import java.util.Arrays
import sbt._
import sbt.Def.taskKey
import sbt.Def.settingKey
import sbt.Def.taskKey
import sbt.Keys._
import sbt.Keys.{`package` => pkg}
import sbt._

import java.io.File
import java.net.URLEncoder
import java.util.Arrays

object ElasticBeanstalkDeployPlugin extends AutoPlugin {

Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/com/earldouglas/xwp/HerokuDeploy.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.earldouglas.xwp

import sbt._
import sbt.Def.taskKey
import sbt.Def.settingKey
import sbt.Def.taskKey
import sbt.Keys._
import sbt.Keys.{`package` => pkg}
import sbt._

object HerokuDeploy extends AutoPlugin {

Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/com/earldouglas/xwp/JettyPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.earldouglas.xwp

import sbt._
import sbt.Def.taskKey
import sbt.Def.settingKey

object JettyPlugin extends AutoPlugin {

Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/com/earldouglas/xwp/TomcatPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.earldouglas.xwp

import sbt._
import sbt.Def.taskKey
import sbt.Def.settingKey

object TomcatPlugin extends AutoPlugin {

Expand Down
3 changes: 1 addition & 2 deletions src/main/scala/com/earldouglas/xwp/WarPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.earldouglas.xwp

import sbt._
import sbt.Def.taskKey
import sbt.Def.settingKey
import sbt.Keys._
import sbt._

object WarPlugin extends AutoPlugin {
import Keys.{`package` => pkg}
Expand Down
13 changes: 6 additions & 7 deletions src/main/scala/com/earldouglas/xwp/WebappPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.earldouglas.xwp

import java.util.jar.Manifest

import sbt._
import sbt.Def.taskKey
import sbt.Def.settingKey
import sbt.Keys._
import sbt.FilesInfo.lastModified
import sbt.Def.taskKey
import sbt.FilesInfo.exists
import sbt.FileFunction.cached
import sbt.FilesInfo.lastModified
import sbt.Keys._
import sbt._

import java.util.jar.Manifest

object WebappPlugin extends AutoPlugin {

Expand Down

0 comments on commit 16ea987

Please sign in to comment.