Skip to content

Commit

Permalink
DAS-356 use dependency plugin + scan + fix code (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
xavji authored May 28, 2021
1 parent 66a017c commit 0b938b9
Show file tree
Hide file tree
Showing 20 changed files with 76 additions and 65 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "main"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
17 changes: 17 additions & 0 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Scala Steward

on:
workflow_dispatch:
schedule:
- cron: "0 4 * * MON"

jobs:
scala-steward:
runs-on: ubuntu-latest
name: Launch Scala Steward
steps:
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
author-email: [email protected]
14 changes: 7 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import Dependencies._
import play.sbt.PlayImport

inThisBuild(
List(
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
scalafixScalaBinaryVersion := "2.13",
scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.5.0"
scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.5.0",
scalacOptions += "-Ywarn-unused"
)
)

Expand All @@ -16,12 +18,10 @@ configs(IntegrationTest)
Defaults.itSettings

libraryDependencies ++= Seq(
Library.Play.ws,
Library.Play.json,
Library.Play.jsonJoda,
Library.testCommon % Test,
Library.DataswiftModels.hatPlay,
Library.DataswiftModels.dexPlay
PlayImport.ws,
Library.HatPlay,
Library.DexPlay,
Library.TestCommon % Test
)

publishMavenStyle := true
Expand Down
20 changes: 4 additions & 16 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,16 @@ import sbt._
object Dependencies {

object Version {
val TestCommon = "0.2.3"
val PlayJson = "2.9.1"
val DsBackend = "2.3.0"
val DsBackend = "2.4.0"
}

val resolvers = Seq(
"HAT Library Artifacts Releases" at "https://s3-eu-west-1.amazonaws.com/library-artifacts-releases.hubofallthings.com"
)

object Library {
object Play {
val ws = "com.typesafe.play" %% "play-ahc-ws" % play.core.PlayVersion.current
val json = "com.typesafe.play" %% "play-json" % Version.PlayJson
val jsonJoda = "com.typesafe.play" %% "play-json-joda" % Version.PlayJson
}

val testCommon = "io.dataswift" %% "test-common" % Version.TestCommon

object DataswiftModels {
val hatPlay = "io.dataswift" %% "hat-play" % Version.DsBackend
val dexPlay = "io.dataswift" %% "dex-play" % Version.DsBackend
}

val TestCommon = "io.dataswift" %% "test-common" % Version.DsBackend
val HatPlay = "io.dataswift" %% "hat-play" % Version.DsBackend
val DexPlay = "io.dataswift" %% "dex-play" % Version.DsBackend
}
}
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resolvers += "HAT Library Artifacts Releases" at "https://s3-eu-west-1.amazonaws.com/library-artifacts-releases.hubofallthings.com"
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")
addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.19.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.27")
addSbtPlugin("io.dataswift" % "sbt-scalatools-common" % "0.2.3")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.19.0")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")
addSbtPlugin("io.dataswift" % "sbt-scalatools-common" % "0.4.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
4 changes: 2 additions & 2 deletions src/main/scala/org/hatdex/dex/api/DexClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

package org.hatdex.dex.api

import javax.inject.Inject

import play.api.Logger
import play.api.libs.ws.WSClient

import javax.inject.Inject

class DexClient(
val ws: WSClient,
val dexAddress: String,
Expand Down
7 changes: 3 additions & 4 deletions src/main/scala/org/hatdex/dex/api/DexDataPlugs.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package org.hatdex.dex.api

import java.util.UUID

import scala.concurrent.{ ExecutionContext, Future }

import play.api.Logger
import play.api.http.Status.OK
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import java.util.UUID
import scala.concurrent.{ ExecutionContext, Future }

trait DexDataPlugs {
val logger: Logger
val ws: WSClient
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/hatdex/dex/api/DexNotices.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.hatdex.dex.api

import scala.concurrent.{ ExecutionContext, Future }

import io.dataswift.models.dex.Notice
import io.dataswift.models.dex.json.DexJsonFormats
import play.api.Logger
import play.api.http.Status.OK
import play.api.libs.json.Json
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import scala.concurrent.{ ExecutionContext, Future }

trait DexNotices {
val logger: Logger
val ws: WSClient
Expand Down
7 changes: 3 additions & 4 deletions src/main/scala/org/hatdex/dex/api/DexOffers.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package org.hatdex.dex.api

import java.util.UUID

import scala.concurrent.{ ExecutionContext, Future }

import io.dataswift.models.dex.OfferClaimsInfo
import play.api.Logger
import play.api.http.Status.OK
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import java.util.UUID
import scala.concurrent.{ ExecutionContext, Future }

trait DexOffers {
val logger: Logger
val ws: WSClient
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/hatdex/dex/api/DexStats.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.hatdex.dex.api

import scala.concurrent.{ ExecutionContext, Future }

import io.dataswift.models.hat.DataStats
import play.api.Logger
import play.api.http.Status.OK
import play.api.libs.json.Json
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import scala.concurrent.{ ExecutionContext, Future }

trait DexStats {

import io.dataswift.models.hat.json.DataStatsFormat.dataStatsFormat
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/hatdex/dex/apiV2/DexApplications.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.hatdex.dex.apiV2

import scala.concurrent.{ ExecutionContext, Future }

import akka.Done
import io.dataswift.models.hat.applications.{ Application, ApplicationDeveloper, ApplicationHistory }
import org.hatdex.dex.apiV2.Errors._
Expand All @@ -10,6 +8,8 @@ import play.api.http.Status.{ CREATED, FORBIDDEN, NOT_FOUND, OK, UNAUTHORIZED }
import play.api.libs.json.{ Format, JsError, JsSuccess, Json }
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import scala.concurrent.{ ExecutionContext, Future }

trait DexApplications {

protected val logger: Logger
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/hatdex/dex/apiV2/DexClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

package org.hatdex.dex.apiV2

import javax.inject.Inject

import org.hatdex.dex.api.{ DexDataPlugs, DexNotices }
import play.api.Logger
import play.api.libs.ws.WSClient

import javax.inject.Inject

class DexClient(
val ws: WSClient,
val dexAddress: String,
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/org/hatdex/dex/apiV2/DexOffers.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.hatdex.dex.apiV2

import scala.concurrent.{ ExecutionContext, Future }

import io.dataswift.models.dex.{ Offer, OfferClaimSummary, OfferClaimsInfo, OfferRegistration }
import org.hatdex.dex.apiV2.Errors._
import play.api.Logger
import play.api.http.Status.{ BAD_REQUEST, CREATED, FORBIDDEN, NOT_FOUND, OK, UNAUTHORIZED }
import play.api.http.Status._
import play.api.libs.json.Json
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import scala.concurrent.{ ExecutionContext, Future }

trait DexOffers {
protected val logger: Logger
protected val ws: WSClient
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/hatdex/dex/apiV2/DexStats.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.hatdex.dex.apiV2

import scala.concurrent.{ ExecutionContext, Future }

import io.dataswift.models.dex.NamespaceStructure
import io.dataswift.models.dex.json.DexJsonFormats
import io.dataswift.models.hat.DataStats
Expand All @@ -11,6 +9,8 @@ import play.api.http.Status.OK
import play.api.libs.json.{ Format, Json }
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import scala.concurrent.{ ExecutionContext, Future }

trait DexStats {

protected val logger: Logger
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/org/hatdex/dex/apiV2/DexUsers.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.hatdex.dex.apiV2

import scala.concurrent.duration._
import scala.concurrent.{ ExecutionContext, Future }

import akka.Done
import play.api.Logger
import play.api.http.Status._
import play.api.libs.json.Json
import play.api.libs.ws._

import scala.concurrent.duration._
import scala.concurrent.{ ExecutionContext, Future }

trait DexUsers {

protected val logger: Logger
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/hatdex/dex/apiV3/DexApplications.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.hatdex.dex.apiV3

import scala.concurrent.{ ExecutionContext, Future }

import akka.Done
import io.dataswift.models.hat.applications.{
Application,
Expand All @@ -22,6 +20,8 @@ import play.api.http.Status.{ CREATED, FORBIDDEN, NOT_FOUND, OK, UNAUTHORIZED }
import play.api.libs.json.{ JsError, JsSuccess, Json }
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import scala.concurrent.{ ExecutionContext, Future }

trait DexApplications {

import io.dataswift.models.hat.json.ApplicationJsonProtocol._
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/hatdex/dex/apiV3/DexClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

package org.hatdex.dex.apiV3

import javax.inject.Inject

import org.hatdex.dex.api.{ DexDataPlugs, DexNotices }
import play.api.Logger
import play.api.libs.ws.WSClient

import javax.inject.Inject

class DexClient(
val ws: WSClient,
val dexAddress: String,
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/org/hatdex/dex/apiV3/DexOffers.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.hatdex.dex.apiV3

import scala.concurrent.{ ExecutionContext, Future }

import io.dataswift.models.dex.{ Offer, OfferClaimSummary, OfferClaimsInfo, OfferRegistration }
import org.hatdex.dex.apiV3.Errors._
import play.api.Logger
import play.api.http.Status.{ BAD_REQUEST, CREATED, FORBIDDEN, NOT_FOUND, OK, UNAUTHORIZED }
import play.api.http.Status._
import play.api.libs.json.Json
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import scala.concurrent.{ ExecutionContext, Future }

trait DexOffers {
protected val logger: Logger
protected val ws: WSClient
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/hatdex/dex/apiV3/DexStats.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.hatdex.dex.apiV3

import scala.concurrent.{ ExecutionContext, Future }

import io.dataswift.models.dex.NamespaceStructure
import io.dataswift.models.dex.json.DexJsonFormats
import io.dataswift.models.hat.DataStats
Expand All @@ -11,6 +9,8 @@ import play.api.http.Status.OK
import play.api.libs.json.{ Format, Json }
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import scala.concurrent.{ ExecutionContext, Future }

trait DexStats {

protected val logger: Logger
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/org/hatdex/dex/apiV3/DexUsers.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.hatdex.dex.apiV3

import scala.concurrent.duration._
import scala.concurrent.{ ExecutionContext, Future }

import akka.Done
import play.api.Logger
import play.api.http.Status.OK
import play.api.libs.json.Json
import play.api.libs.ws.{ WSClient, WSRequest, WSResponse }

import scala.concurrent.duration._
import scala.concurrent.{ ExecutionContext, Future }

trait DexUsers {

protected val logger: Logger
Expand Down

0 comments on commit 0b938b9

Please sign in to comment.