Skip to content

Commit

Permalink
Upgrade Scala 2.13.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfredo Torre committed Dec 14, 2023
1 parent 0661dc4 commit 9646c85
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 28 deletions.
18 changes: 18 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version = "3.7.17"

runner.dialect = scala213source3
align.preset = more
align.openParenCallSite = true
align.openParenDefnSite = true
style = defaultWithAlign
maxColumn = 115
indent.extendSite = 4
indent.withSiteRelativeToExtends = 2
docstrings = "ScalaDoc"
docstrings.style = Asterisk
docstrings.removeEmpty = true
continuationIndent.callSite = 2
continuationIndent.defnSite = 4
includeCurlyBraceInSelectChains = false
project.git = true
project.excludeFilters = ["target/"]
32 changes: 18 additions & 14 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import sbt.Keys._

Global / onChangedBuildSource := ReloadOnSourceChanges

lazy val buildSettings = Seq(
organization := "io.kontainers",
scalaVersion := "2.13.10",
organization := "io.kontainers",
scalaVersion := "2.13.12",
crossScalaVersions := Seq("2.12.15", scalaVersion.value)
)

lazy val publishSettings = Seq(
publishMavenStyle := true,
Test/ publishArtifact := false,
publishMavenStyle := true,
Test / publishArtifact := false,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
Opts.resolver.sbtSnapshots
else
Opts.resolver.sonatypeStaging),
pomIncludeRepository := { x => false },
pomExtra := (
Opts.resolver.sonatypeStaging
),
pomIncludeRepository := { x => false },
pomExtra := (
<url>https://github.com/kontainers/PureCSV</url>
<licenses>
<license>
Expand All @@ -42,15 +45,16 @@ lazy val publishSettings = Seq(
)
)

lazy val pureCSV = project.in(file(".")).
settings(buildSettings).
settings(publishSettings).
settings(
lazy val pureCSV = project
.in(file("."))
.settings(buildSettings)
.settings(publishSettings)
.settings(
name := "purecsv",
scalacOptions ++= Seq("-feature", "-deprecation"),
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.3.10",
"com.chuusai" %% "shapeless" % "2.3.10",
"com.github.tototoshi" %% "scala-csv" % "1.3.10",
"org.scalatest" %% "scalatest" % "3.2.14" % Test
"org.scalatest" %% "scalatest" % "3.2.17" % Test
)
)
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.7.2
sbt.version=1.9.7
20 changes: 10 additions & 10 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* sbt-updates
*
* for easier dependency updates monitoring
* @see https://github.com/rtimush/sbt-updates
*/
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")

addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
* sbt-updates
*
* for easier dependency updates monitoring
* @see
* https://github.com/rtimush/sbt-updates
*/
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
2 changes: 1 addition & 1 deletion src/main/scala/purecsv/safe/tryutil/TryUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ package object tryutil {
}
}

implicit class IteratorOfTry[A](iter: Iterator[Try[A]]) extends IterableOfTry[A](iter.toIterable)
implicit class IteratorOfTry[A](iter: Iterator[Try[A]]) extends IterableOfTry[A](iter.iterator.to(Iterable))

}
2 changes: 1 addition & 1 deletion src/main/scala/purecsv/unsafe/RecordSplitterImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ object RecordSplitterImpl extends RecordSplitter[Reader] {
fields: Seq[String],
headerMapping: Map[String, String]) =
csvReader.iteratorWithHeaders
.map(line => line.mapValues(trimming.trim))
.map(line => line.view.mapValues(trimming.trim))
.filter(array => array.size != 1 || array.head._2.trim != EmptyString)
.map(f => fields.map(field => f.getOrElse(headerMapping.getOrElse(field, field), EmptyString)))

Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/purecsv/safe/TryUtilSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MyException(val s: String) extends RuntimeException(s) {
class TryUtilSuite extends AnyFunSuite with Matchers {
import tryutil._

def failure(s: String) = Failure(new MyException(s))
def failure(s: String): Failure[RuntimeException] = Failure(new MyException(s))

test("getSuccessesAndFailures partition an Iterator[Try[A]] into successes and failures") {
val startingSuccesses = Seq(Success(1),Success(2))
Expand Down

0 comments on commit 9646c85

Please sign in to comment.