Skip to content

Commit d456e9a

Browse files
authored
Merge pull request #2183 from typelevel/scalafmt_3.8.6
Scalafmt 3.8.6
2 parents ff1b56b + 74b6122 commit d456e9a

32 files changed

+63
-39
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
8c04f656ec5e21d6142ebde4539a00003b27a499
44
f6e03013f4c4a29074f528ac468129bdd2df63d3
55
13d6c997bb231bbae2bb1a9427d0fc4eb226e853
6+
7+
# Upgrade to scalafmt 3.8.6
8+
1c373a90e8fd788b666b037150e8912427708726

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=3.8.2
1+
version=3.8.6
22
maxColumn = 120
33
assumeStandardLibraryStripMargin = true
44

modules/bench/src/main/scala/doobie/bench/large.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class LargeRow {
5050
col8 VARCHAR(50)
5151
);""".update.run
5252
_ <- sql"select setseed(0.5)".query[Unit].unique // deterministic seed
53-
_ <- sql"""INSERT INTO data (col1, col2, col3, col4, col5, col6, col7, col8)
53+
_ <-
54+
sql"""INSERT INTO data (col1, col2, col3, col4, col5, col6, col7, col8)
5455
SELECT random(), random() :: text, (random() * 1000) :: int, random() :: text, random(), random(), random() :: text, random() :: text
5556
FROM generate_series(1, 10000)
5657
""".update.run
@@ -74,7 +75,15 @@ class LargeRow {
7475
@Benchmark
7576
def tupleOpt(bh: Blackhole): Unit = {
7677
bh.consume(sql"""SELECT col1, col2, col3, col4, col5, col6, col7, col8 FROM data"""
77-
.query[Option[(Double, String, Int, String, Double, Double, String, String)]].to[List].transact(xa).unsafeRunSync())
78+
.query[Option[(
79+
Double,
80+
String,
81+
Int,
82+
String,
83+
Double,
84+
Double,
85+
String,
86+
String)]].to[List].transact(xa).unsafeRunSync())
7887
}
7988

8089
@Benchmark

modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ trait MkWritePlatform:
3232
new Derived(
3333
new MkWrite(Write.Composite(
3434
List(headInstance),
35-
{ case h *: EmptyTuple => List(h) }
35+
{ case h *: EmptyTuple =>
36+
List(h)
37+
}
3638
))
3739
)
3840
}
@@ -49,7 +51,9 @@ trait MkWritePlatform:
4951
new Derived(
5052
new MkWrite(Write.Composite(
5153
List(headWrite, tailWrite),
52-
{ case h *: t => List(h, t) }
54+
{ case h *: t =>
55+
List(h, t)
56+
}
5357
))
5458
)
5559
}

modules/core/src/main/scala/doobie/util/analysis.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ object analysis {
7070
override def msg = this match {
7171
case ColumnMisalignment(_, Left((get, n))) =>
7272
s"""|Too few columns are selected, which will result in a runtime failure. Add a column or
73-
|remove mapped ${typeName(get.typeStack.last, n)} from the result type.""".stripMargin.linesIterator.mkString(
73+
|remove mapped ${typeName(
74+
get.typeStack.last,
75+
n)} from the result type.""".stripMargin.linesIterator.mkString(
7476
" ")
7577
case ColumnMisalignment(_, Right(_)) =>
7678
s"""Column is unused. Remove it from the SELECT statement."""

modules/core/src/main/scala/doobie/util/invariant.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ object invariant {
5555
final case class NonNullableColumnUpdate(index: Int, jdbcType: JdbcType)
5656
extends MappingViolation(
5757
show"Scala `null` value passed as update to column $index (JDBC type $jdbcType); use an Option type here. $oneBasedDisclaimer")
58-
final case class NonNullableColumnRead(index: Int, jdbcType: JdbcType)
59-
extends MappingViolation(show"SQL `NULL` read at column $index (JDBC type $jdbcType) but mapping is to a non-Option type; use Option here. $oneBasedDisclaimer")
58+
final case class NonNullableColumnRead(
59+
index: Int,
60+
jdbcType: JdbcType
61+
) extends MappingViolation(show"SQL `NULL` read at column $index (JDBC type $jdbcType) but mapping is to a non-Option type; use Option here. $oneBasedDisclaimer")
6062

6163
/** Array violations. Not terribly illuminating at this point. */
6264
sealed abstract class ArrayStructureViolation(msg: String) extends InvariantViolation(msg)

modules/core/src/main/scala/doobie/util/meta/meta.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ trait MetaInstances {
181181
List(TinyInt, Integer, BigInt, Real, Float, Double, Decimal, Numeric, Bit, Char, VarChar, LongVarChar),
182182
_.getShort(_),
183183
_.setShort(_, _),
184-
_.updateShort(_, _))
184+
_.updateShort(_, _)
185+
)
185186

186187
/** @group Instances */
187188
implicit val IntMeta: Meta[Int] =
@@ -208,7 +209,8 @@ trait MetaInstances {
208209
List(TinyInt, Integer, SmallInt, BigInt, Float, Double, Decimal, Numeric, Bit, Char, VarChar, LongVarChar),
209210
_.getFloat(_),
210211
_.setFloat(_, _),
211-
_.updateFloat(_, _))
212+
_.updateFloat(_, _)
213+
)
212214

213215
/** @group Instances */
214216
implicit val DoubleMeta: Meta[Double] =

modules/example/src/main/scala/example/StreamingCopy.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ object StreamingCopy extends IOApp.Simple {
137137
url = "jdbc:postgresql:world",
138138
user = "postgres",
139139
password = "password",
140-
logHandler = None
140+
logHandler =
141+
None
141142
))
142143

143144
// An h2 transactor for our sink.

modules/free/src/main/scala/doobie/free/blob.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,6 @@ object blob { module =>
233233
implicit def SemigroupBlobIO[A : Semigroup]: Semigroup[BlobIO[A]] = new Semigroup[BlobIO[A]] {
234234
override def combine(x: BlobIO[A], y: BlobIO[A]): BlobIO[A] =
235235
Applicative[BlobIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) }
236-
}
236+
}
237237
}
238238

modules/free/src/main/scala/doobie/free/callablestatement.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,6 @@ object callablestatement { module =>
13641364
implicit def SemigroupCallableStatementIO[A : Semigroup]: Semigroup[CallableStatementIO[A]] = new Semigroup[CallableStatementIO[A]] {
13651365
override def combine(x: CallableStatementIO[A], y: CallableStatementIO[A]): CallableStatementIO[A] =
13661366
Applicative[CallableStatementIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) }
1367-
}
1367+
}
13681368
}
13691369

0 commit comments

Comments
 (0)