Skip to content
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
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ jobs:
test:
uses: evolution-gaming/scala-github-actions/.github/workflows/ci.yml@dde27b9bd793d41d5aacf8fb74403c9de5da1146 # v6.3.0
with:
scala_versions: '["2.13.16", "3.3.6"]'
# TODO no sbt-version-policy in this repo, so binary compatibility was never checked
version_policy_check: false
# TODO no sbt-scalafmt in this repo, so formatting was never checked
scalafmt_check: false
96 changes: 96 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Main goals:
# - nicer commit diffs (trailing commas, no alignment for pattern matching, force new lines)
# - better interop with default IntelliJ IDEA setup (matching import and modifiers sorting logic)
# - better developer experience on laptop screens (like 16' MBPs) with IntelliJ IDEA (line wraps)

version = 3.11.5

runner.dialect = scala213source3

# only format files tracked by git
project.git = true

maxColumn = 120
trailingCommas = always

preset = default
# do not align to make nicer commit diffs
align.preset = none

indent {
# altering defnSite and extendSite to have this:
# final class MyErr extends RuntimeException(
# "super error message",
# )
# instead of this:
# final class MyErr extends RuntimeException(
# "super error message",
# )
defnSite = 2
extendSite = 0
}

spaces {
# makes string interpolation with curlies more visually distinct
inInterpolatedStringCurlyBraces = true
}

newlines {
# keep author new lines where possible
source = keep
# force new line after "(implicit" for multi-line arg lists
implicitParamListModifierForce = [after]
avoidForSimpleOverflow = [
tooLong, # if the line would be too long even after newline inserted, do nothing
slc, # do nothing if overflow caused by single line comment
]
}

verticalMultiline {
atDefnSite = true
arityThreshold = 4 # more than 3 args in a list will be turned vertical
newlineAfterOpenParen = true # for nicer commit diffs
}

# for nicer commit diffs - forces new line before last parenthesis:
# class MyCls(
# arg1: String,
# arg2: String,
# ) extends MyTrait {
#
# without it:
# class MyCls(
# arg1: String,
# arg2: String) extends MyTrait {
danglingParentheses.exclude = []

docstrings {
# easier to view diffs in IDEA on 16' MBP screen if docs max line are shorter than code
wrapMaxColumn = 100
# next settings make it similar to the default IDEA javadoc formatting
style = Asterisk
oneline = unfold
blankFirstLine = unfold
}

rewrite.rules = [
Imports,
RedundantParens,
SortModifiers,
prefercurlyfors,
]

# put visibility modifier first
rewrite.sortModifiers.preset = styleGuide

# Import sorting as similar as possible to scalafix's "OrganizeImports.preset = INTELLIJ_2020_3".
# Scalafix is not used as its commands mess up "all .." build aliases and it takes long time to run,
# while its code semantic based features are not needed here.
# I.e. detection of unused imports is done with Scala compiler options.
rewrite.imports {
sort = ascii
groups = [
[".*"],
["java\\..*", "javax\\..*", "scala\\..*"],
]
}
16 changes: 9 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ name := "ddata-tools"

organization := "com.evolutiongaming"

homepage := Some(url("https://github.com/evolution-gaming/ddata-tools"))
homepage := Some(uri("https://github.com/evolution-gaming/ddata-tools"))

startYear := Some(2018)

organizationName := "Evolution"

organizationHomepage := Some(url("https://evolution.com"))
organizationHomepage := Some(uri("https://evolution.com"))

scalaVersion := crossScalaVersions.value.head

crossScalaVersions := Seq("2.13.16", "3.3.6")
crossScalaVersions := Seq("2.13.18", "3.3.8")

Compile / doc / scalacOptions ++= Seq("-release:17", "-deprecation", "-no-link-warnings")

Expand All @@ -30,12 +30,14 @@ libraryDependencies ++= Seq(
`executor-tools`,
`cats-helper`,
smetrics,
scalatest % Test)
scalatest % Test,
)

licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT")))
licenses := Seq(("MIT", uri("https://opensource.org/licenses/MIT")))

scalacOptsFailOnWarn := Some(false)

//addCommandAlias("check", "all versionPolicyCheck Compile/doc")
addCommandAlias("check", "show version")
addCommandAlias("build", "+all compile test")
addCommandAlias("check", "+all scalafmtCheckRepo Compile/doc")
addCommandAlias("fmt", "+scalafmtRepo")
addCommandAlias("build", "+all compile testFull")
14 changes: 7 additions & 7 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import sbt._
object Dependencies {

val `executor-tools` = "com.evolutiongaming" %% "executor-tools" % "1.0.5"
val scalatest = "org.scalatest" %% "scalatest" % "3.2.19"
val `cats-helper` = "com.evolutiongaming" %% "cats-helper" % "3.12.0"
val smetrics = "com.evolutiongaming" %% "smetrics" % "2.3.2"
val scalatest = "org.scalatest" %% "scalatest" % "3.2.19"
val `cats-helper` = "com.evolutiongaming" %% "cats-helper" % "3.12.0"
val smetrics = "com.evolutiongaming" %% "smetrics" % "2.3.2"

object Cats {
val core = "org.typelevel" %% "cats-core" % "2.13.0"
val core = "org.typelevel" %% "cats-core" % "2.13.0"
val effect = "org.typelevel" %% "cats-effect" % "3.5.7"
}

object Akka {
private val version = "2.6.21"
val actor = "com.typesafe.akka" %% "akka-actor" % version
val cluster = "com.typesafe.akka" %% "akka-cluster" % version
val actor = "com.typesafe.akka" %% "akka-actor" % version
val cluster = "com.typesafe.akka" %% "akka-cluster" % version
val `distributed-data` = "com.typesafe.akka" %% "akka-distributed-data" % version
val testkit = "com.typesafe.akka" %% "akka-testkit" % version
val testkit = "com.typesafe.akka" %% "akka-testkit" % version
}
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.11.3
sbt.version = 2.0.6
8 changes: 5 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.3.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.4.4")

addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.1")

addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.0.9")
addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.2.0")

addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")
addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.1.2")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.2")
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cats.implicits._
import scala.util.control.NoStackTrace

sealed abstract class ReplicatorError(msg: Option[String], cause: Option[Throwable])
extends RuntimeException(msg.orNull, cause.orNull) with NoStackTrace
extends RuntimeException(msg.orNull, cause.orNull) with NoStackTrace

object ReplicatorError {

Expand All @@ -23,7 +23,6 @@ object ReplicatorError {

def unknown(msg: String): ReplicatorError = Unknown(msg)


case object DataDeleted extends ReplicatorError(none, none)

case object GetFailure extends ReplicatorError(none, none)
Expand Down
Loading