Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
scala:
- 2.13.18
- 3.3.7
- 3.3.8

steps:
- uses: actions/checkout@v4
Expand All @@ -32,16 +32,23 @@ jobs:
uses: sbt/setup-sbt@v1

- name: check code ${{ matrix.scala }}
run: sbt ++${{ matrix.scala }} clean check
run: sbt "++${{ matrix.scala }}; clean; check"

- name: build ${{ matrix.scala }}
run: sbt ++${{ matrix.scala }} clean coverage test
run: sbt "++${{ matrix.scala }}; clean; coverage; test; coverageAggregate"

- name: locate coverage report
id: coverage
if: success()
run: echo "file=$(find . -path '*/coverage-report/cobertura.xml' | head -1)" >> "$GITHUB_OUTPUT"

- name: test coverage
if: success()
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: sbt ++${{ matrix.scala }} coverageReport coverageAggregate coveralls
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8
with:
file: ${{ steps.coverage.outputs.file }}
format: cobertura
flag-name: Scala ${{ matrix.scala }}

- name: slack
uses: homoluctus/slatify@master
Expand Down
61 changes: 61 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version = 3.11.5

runner.dialect = scala213source3

project.git = true

maxColumn = 120
trailingCommas = always

preset = default
align.preset = none

indent {
defnSite = 2
extendSite = 0
}

spaces {
inInterpolatedStringCurlyBraces = true
}

newlines {
source = keep
implicitParamListModifierForce = [after]
avoidForSimpleOverflow = [
tooLong,
slc,
]
}

verticalMultiline {
atDefnSite = true
arityThreshold = 4
newlineAfterOpenParen = true
}

danglingParentheses.exclude = []

docstrings {
wrapMaxColumn = 100
style = Asterisk
oneline = unfold
blankFirstLine = unfold
}

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

rewrite.sortModifiers.preset = styleGuide

rewrite.imports {
sort = ascii
groups = [
[".*"],
["java\\..*", "javax\\..*", "scala\\..*"],
]
}
77 changes: 44 additions & 33 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,53 @@ lazy val commonSettings = Seq(
crossScalaVersions := Seq("2.13.18", "3.3.8"),
Compile / doc / scalacOptions ++= Seq("-groups", "-implicits", "-no-link-warnings"),
publishTo := Some(Resolver.evolutionReleases),
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))))
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))),
Comment thread
mr-git marked this conversation as resolved.
Outdated
Test / scalacOptions -= "-Wnonunit-statement",
)

val alias: Seq[sbt.Def.Setting[?]] =
addCommandAlias("check", "all versionPolicyCheck Compile/doc") ++
addCommandAlias("fmt", "+all scalafmtRepo") ++
addCommandAlias("check", "all versionPolicyCheck Compile/doc scalafmtCheckRepo") ++
addCommandAlias("build", "all compile test")

lazy val root = (project in file(".")
settings (name := "cassandra-sync")
settings commonSettings
settings (alias)
settings (
publish / skip := true,
skip / publishArtifact := true)
aggregate(`cassandra-sync`, tests))
lazy val root =
(project in file(".")
settings (name := "cassandra-sync")
settings (normalizedName := "root")
settings commonSettings
settings alias
settings (
publish / skip := true,
skip / publishArtifact := true,
)
aggregate (`cassandra-sync`, tests))

lazy val `cassandra-sync` = (project in file("cassandra-sync")
settings (name := "cassandra-sync")
settings commonSettings
settings (libraryDependencies ++= Seq(
`future-helper`,
scalatest % Test,
scassandra)))
lazy val `cassandra-sync` =
(project in file("cassandra-sync")
settings (name := "cassandra-sync")
settings commonSettings
settings (libraryDependencies ++= Seq(
`future-helper`,
scalatest % Test,
scassandra,
)))

lazy val tests = (project in file("tests")
settings (name := "tests")
settings commonSettings
settings Seq(
publish / skip := true,
skip / publishArtifact := true,
Test / fork := true,
Test / parallelExecution := false)
dependsOn `cassandra-sync` % "test->test;compile->compile"
settings (libraryDependencies ++= Seq(
`testcontainers-cassandra` % Test,
Slf4j.api % Test,
Slf4j.`log4j-over-slf4j` % Test,
Logback.core % Test,
Logback.classic % Test,
scalatest % Test)))
lazy val tests =
(project in file("tests")
settings (name := "tests")
settings commonSettings
settings Seq(
publish / skip := true,
skip / publishArtifact := true,
Test / fork := true,
Test / parallelExecution := false,
)
dependsOn `cassandra-sync` % "test->test;compile->compile"
settings (libraryDependencies ++= Seq(
`testcontainers-cassandra` % Test,
Slf4j.api % Test,
Slf4j.`log4j-over-slf4j` % Test,
Logback.core % Test,
Logback.classic % Test,
scalatest % Test,
)))
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ object AutoCreate {
case object None extends AutoCreate

case object Table extends AutoCreate


final case class KeyspaceAndTable(replicationStrategy: ReplicationStrategyConfig) extends AutoCreate

object KeyspaceAndTable {
val Default: KeyspaceAndTable = KeyspaceAndTable(ReplicationStrategyConfig.Default)
}
}
}
Loading
Loading