From 1c373a90e8fd788b666b037150e8912427708726 Mon Sep 17 00:00:00 2001 From: Jacob Wang Date: Sat, 1 Feb 2025 20:15:26 +0000 Subject: [PATCH 1/2] Upgrade scalafmt to 3.8.6 --- .scalafmt.conf | 2 +- .../bench/src/main/scala/doobie/bench/large.scala | 13 +++++++++++-- .../main/scala-3/doobie/util/MkWritePlatform.scala | 8 ++++++-- .../core/src/main/scala/doobie/util/analysis.scala | 4 +++- .../core/src/main/scala/doobie/util/invariant.scala | 6 ++++-- .../core/src/main/scala/doobie/util/meta/meta.scala | 6 ++++-- .../src/main/scala/example/StreamingCopy.scala | 3 ++- modules/free/src/main/scala/doobie/free/blob.scala | 2 +- .../main/scala/doobie/free/callablestatement.scala | 2 +- modules/free/src/main/scala/doobie/free/clob.scala | 2 +- .../src/main/scala/doobie/free/connection.scala | 2 +- .../main/scala/doobie/free/databasemetadata.scala | 2 +- .../free/src/main/scala/doobie/free/driver.scala | 2 +- .../main/scala/doobie/free/kleisliinterpreter.scala | 4 ++-- modules/free/src/main/scala/doobie/free/nclob.scala | 2 +- .../main/scala/doobie/free/preparedstatement.scala | 2 +- modules/free/src/main/scala/doobie/free/ref.scala | 2 +- .../free/src/main/scala/doobie/free/resultset.scala | 2 +- .../free/src/main/scala/doobie/free/sqldata.scala | 2 +- .../free/src/main/scala/doobie/free/sqlinput.scala | 2 +- .../free/src/main/scala/doobie/free/sqloutput.scala | 2 +- .../free/src/main/scala/doobie/free/statement.scala | 2 +- .../main/scala/doobie/postgres/free/copyin.scala | 2 +- .../scala/doobie/postgres/free/copymanager.scala | 2 +- .../main/scala/doobie/postgres/free/copyout.scala | 2 +- .../doobie/postgres/free/kleisliinterpreter.scala | 4 ++-- .../scala/doobie/postgres/free/largeobject.scala | 2 +- .../doobie/postgres/free/largeobjectmanager.scala | 2 +- .../scala/doobie/postgres/free/pgconnection.scala | 2 +- .../src/test/scala/doobie/weaver/CheckerTests.scala | 3 ++- project/FreeGen2.scala | 6 +++--- 31 files changed, 60 insertions(+), 39 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 4537afeb5..8b104de31 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version=3.8.2 +version=3.8.6 maxColumn = 120 assumeStandardLibraryStripMargin = true diff --git a/modules/bench/src/main/scala/doobie/bench/large.scala b/modules/bench/src/main/scala/doobie/bench/large.scala index d35dddd14..ba25f6987 100644 --- a/modules/bench/src/main/scala/doobie/bench/large.scala +++ b/modules/bench/src/main/scala/doobie/bench/large.scala @@ -50,7 +50,8 @@ class LargeRow { col8 VARCHAR(50) );""".update.run _ <- sql"select setseed(0.5)".query[Unit].unique // deterministic seed - _ <- sql"""INSERT INTO data (col1, col2, col3, col4, col5, col6, col7, col8) + _ <- + sql"""INSERT INTO data (col1, col2, col3, col4, col5, col6, col7, col8) SELECT random(), random() :: text, (random() * 1000) :: int, random() :: text, random(), random(), random() :: text, random() :: text FROM generate_series(1, 10000) """.update.run @@ -74,7 +75,15 @@ class LargeRow { @Benchmark def tupleOpt(bh: Blackhole): Unit = { bh.consume(sql"""SELECT col1, col2, col3, col4, col5, col6, col7, col8 FROM data""" - .query[Option[(Double, String, Int, String, Double, Double, String, String)]].to[List].transact(xa).unsafeRunSync()) + .query[Option[( + Double, + String, + Int, + String, + Double, + Double, + String, + String)]].to[List].transact(xa).unsafeRunSync()) } @Benchmark diff --git a/modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala b/modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala index 91f393017..94defd2c7 100644 --- a/modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala +++ b/modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala @@ -32,7 +32,9 @@ trait MkWritePlatform: new Derived( new MkWrite(Write.Composite( List(headInstance), - { case h *: EmptyTuple => List(h) } + { case h *: EmptyTuple => + List(h) + } )) ) } @@ -49,7 +51,9 @@ trait MkWritePlatform: new Derived( new MkWrite(Write.Composite( List(headWrite, tailWrite), - { case h *: t => List(h, t) } + { case h *: t => + List(h, t) + } )) ) } diff --git a/modules/core/src/main/scala/doobie/util/analysis.scala b/modules/core/src/main/scala/doobie/util/analysis.scala index 97e8733d3..c6c1ca777 100644 --- a/modules/core/src/main/scala/doobie/util/analysis.scala +++ b/modules/core/src/main/scala/doobie/util/analysis.scala @@ -70,7 +70,9 @@ object analysis { override def msg = this match { case ColumnMisalignment(_, Left((get, n))) => s"""|Too few columns are selected, which will result in a runtime failure. Add a column or - |remove mapped ${typeName(get.typeStack.last, n)} from the result type.""".stripMargin.linesIterator.mkString( + |remove mapped ${typeName( + get.typeStack.last, + n)} from the result type.""".stripMargin.linesIterator.mkString( " ") case ColumnMisalignment(_, Right(_)) => s"""Column is unused. Remove it from the SELECT statement.""" diff --git a/modules/core/src/main/scala/doobie/util/invariant.scala b/modules/core/src/main/scala/doobie/util/invariant.scala index 2720340fa..8502ed721 100644 --- a/modules/core/src/main/scala/doobie/util/invariant.scala +++ b/modules/core/src/main/scala/doobie/util/invariant.scala @@ -55,8 +55,10 @@ object invariant { final case class NonNullableColumnUpdate(index: Int, jdbcType: JdbcType) extends MappingViolation( show"Scala `null` value passed as update to column $index (JDBC type $jdbcType); use an Option type here. $oneBasedDisclaimer") - final case class NonNullableColumnRead(index: Int, jdbcType: JdbcType) - extends MappingViolation(show"SQL `NULL` read at column $index (JDBC type $jdbcType) but mapping is to a non-Option type; use Option here. $oneBasedDisclaimer") + final case class NonNullableColumnRead( + index: Int, + jdbcType: JdbcType + ) extends MappingViolation(show"SQL `NULL` read at column $index (JDBC type $jdbcType) but mapping is to a non-Option type; use Option here. $oneBasedDisclaimer") /** Array violations. Not terribly illuminating at this point. */ sealed abstract class ArrayStructureViolation(msg: String) extends InvariantViolation(msg) diff --git a/modules/core/src/main/scala/doobie/util/meta/meta.scala b/modules/core/src/main/scala/doobie/util/meta/meta.scala index 12d036dee..9ceddf4d2 100644 --- a/modules/core/src/main/scala/doobie/util/meta/meta.scala +++ b/modules/core/src/main/scala/doobie/util/meta/meta.scala @@ -181,7 +181,8 @@ trait MetaInstances { List(TinyInt, Integer, BigInt, Real, Float, Double, Decimal, Numeric, Bit, Char, VarChar, LongVarChar), _.getShort(_), _.setShort(_, _), - _.updateShort(_, _)) + _.updateShort(_, _) + ) /** @group Instances */ implicit val IntMeta: Meta[Int] = @@ -208,7 +209,8 @@ trait MetaInstances { List(TinyInt, Integer, SmallInt, BigInt, Float, Double, Decimal, Numeric, Bit, Char, VarChar, LongVarChar), _.getFloat(_), _.setFloat(_, _), - _.updateFloat(_, _)) + _.updateFloat(_, _) + ) /** @group Instances */ implicit val DoubleMeta: Meta[Double] = diff --git a/modules/example/src/main/scala/example/StreamingCopy.scala b/modules/example/src/main/scala/example/StreamingCopy.scala index bfede08b8..85b5c694d 100644 --- a/modules/example/src/main/scala/example/StreamingCopy.scala +++ b/modules/example/src/main/scala/example/StreamingCopy.scala @@ -137,7 +137,8 @@ object StreamingCopy extends IOApp.Simple { url = "jdbc:postgresql:world", user = "postgres", password = "password", - logHandler = None + logHandler = + None )) // An h2 transactor for our sink. diff --git a/modules/free/src/main/scala/doobie/free/blob.scala b/modules/free/src/main/scala/doobie/free/blob.scala index a5f7b42c8..f4fc08904 100644 --- a/modules/free/src/main/scala/doobie/free/blob.scala +++ b/modules/free/src/main/scala/doobie/free/blob.scala @@ -233,6 +233,6 @@ object blob { module => implicit def SemigroupBlobIO[A : Semigroup]: Semigroup[BlobIO[A]] = new Semigroup[BlobIO[A]] { override def combine(x: BlobIO[A], y: BlobIO[A]): BlobIO[A] = Applicative[BlobIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/callablestatement.scala b/modules/free/src/main/scala/doobie/free/callablestatement.scala index 9c4e341a6..74242070c 100644 --- a/modules/free/src/main/scala/doobie/free/callablestatement.scala +++ b/modules/free/src/main/scala/doobie/free/callablestatement.scala @@ -1364,6 +1364,6 @@ object callablestatement { module => implicit def SemigroupCallableStatementIO[A : Semigroup]: Semigroup[CallableStatementIO[A]] = new Semigroup[CallableStatementIO[A]] { override def combine(x: CallableStatementIO[A], y: CallableStatementIO[A]): CallableStatementIO[A] = Applicative[CallableStatementIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/clob.scala b/modules/free/src/main/scala/doobie/free/clob.scala index 76d773cc3..69df3370c 100644 --- a/modules/free/src/main/scala/doobie/free/clob.scala +++ b/modules/free/src/main/scala/doobie/free/clob.scala @@ -246,6 +246,6 @@ object clob { module => implicit def SemigroupClobIO[A : Semigroup]: Semigroup[ClobIO[A]] = new Semigroup[ClobIO[A]] { override def combine(x: ClobIO[A], y: ClobIO[A]): ClobIO[A] = Applicative[ClobIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/connection.scala b/modules/free/src/main/scala/doobie/free/connection.scala index 75e89dead..ad28ee020 100644 --- a/modules/free/src/main/scala/doobie/free/connection.scala +++ b/modules/free/src/main/scala/doobie/free/connection.scala @@ -493,6 +493,6 @@ object connection { module => implicit def SemigroupConnectionIO[A : Semigroup]: Semigroup[ConnectionIO[A]] = new Semigroup[ConnectionIO[A]] { override def combine(x: ConnectionIO[A], y: ConnectionIO[A]): ConnectionIO[A] = Applicative[ConnectionIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/databasemetadata.scala b/modules/free/src/main/scala/doobie/free/databasemetadata.scala index 0703e4fab..6d31d6434 100644 --- a/modules/free/src/main/scala/doobie/free/databasemetadata.scala +++ b/modules/free/src/main/scala/doobie/free/databasemetadata.scala @@ -1076,6 +1076,6 @@ object databasemetadata { module => implicit def SemigroupDatabaseMetaDataIO[A : Semigroup]: Semigroup[DatabaseMetaDataIO[A]] = new Semigroup[DatabaseMetaDataIO[A]] { override def combine(x: DatabaseMetaDataIO[A], y: DatabaseMetaDataIO[A]): DatabaseMetaDataIO[A] = Applicative[DatabaseMetaDataIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/driver.scala b/modules/free/src/main/scala/doobie/free/driver.scala index 5a1eb880e..bb4beb4bd 100644 --- a/modules/free/src/main/scala/doobie/free/driver.scala +++ b/modules/free/src/main/scala/doobie/free/driver.scala @@ -216,6 +216,6 @@ object driver { module => implicit def SemigroupDriverIO[A : Semigroup]: Semigroup[DriverIO[A]] = new Semigroup[DriverIO[A]] { override def combine(x: DriverIO[A], y: DriverIO[A]): DriverIO[A] = Applicative[DriverIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/kleisliinterpreter.scala b/modules/free/src/main/scala/doobie/free/kleisliinterpreter.scala index e803cb35f..a837899fe 100644 --- a/modules/free/src/main/scala/doobie/free/kleisliinterpreter.scala +++ b/modules/free/src/main/scala/doobie/free/kleisliinterpreter.scala @@ -121,10 +121,10 @@ class KleisliInterpreter[M[_]](logHandler: LogHandler[M])(implicit val asyncM: W def forceR[G[_], J, A, B](interpreter: G ~> Kleisli[M, J, *])(fa: Free[G, A])(fb: Free[G, B]): Kleisli[M, J, B] = Kleisli (j => asyncM.forceR(fa.foldMap(interpreter).run(j))(fb.foldMap(interpreter).run(j)) ) - def uncancelable[G[_], J, A](interpreter: G ~> Kleisli[M, J, *], capture: Poll[M] => Poll[Free[G, *]])(body: Poll[Free[G, *]] => Free[G, A]): Kleisli[M, J, A] = Kleisli(j => + def uncancelable[G[_], J, A](interpreter: G ~> Kleisli[M, J, *], capture: Poll[M] => Poll[Free[G, *]])(body: Poll[Free[G, *]] => Free[G, A]): Kleisli[M, J, A] = Kleisli(j => asyncM.uncancelable(body.compose(capture).andThen(_.foldMap(interpreter).run(j))) ) - def poll[G[_], J, A](interpreter: G ~> Kleisli[M, J, *])(mpoll: Any, fa: Free[G, A]): Kleisli[M, J, A] = Kleisli(j => + def poll[G[_], J, A](interpreter: G ~> Kleisli[M, J, *])(mpoll: Any, fa: Free[G, A]): Kleisli[M, J, A] = Kleisli(j => mpoll.asInstanceOf[Poll[M]].apply(fa.foldMap(interpreter).run(j)) ) def onCancel[G[_], J, A](interpreter: G ~> Kleisli[M, J, *])(fa: Free[G, A], fin: Free[G, Unit]): Kleisli[M, J, A] = Kleisli (j => diff --git a/modules/free/src/main/scala/doobie/free/nclob.scala b/modules/free/src/main/scala/doobie/free/nclob.scala index d6be4b115..2ee406e83 100644 --- a/modules/free/src/main/scala/doobie/free/nclob.scala +++ b/modules/free/src/main/scala/doobie/free/nclob.scala @@ -247,6 +247,6 @@ object nclob { module => implicit def SemigroupNClobIO[A : Semigroup]: Semigroup[NClobIO[A]] = new Semigroup[NClobIO[A]] { override def combine(x: NClobIO[A], y: NClobIO[A]): NClobIO[A] = Applicative[NClobIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/preparedstatement.scala b/modules/free/src/main/scala/doobie/free/preparedstatement.scala index 57354d279..74b70e660 100644 --- a/modules/free/src/main/scala/doobie/free/preparedstatement.scala +++ b/modules/free/src/main/scala/doobie/free/preparedstatement.scala @@ -764,6 +764,6 @@ object preparedstatement { module => implicit def SemigroupPreparedStatementIO[A : Semigroup]: Semigroup[PreparedStatementIO[A]] = new Semigroup[PreparedStatementIO[A]] { override def combine(x: PreparedStatementIO[A], y: PreparedStatementIO[A]): PreparedStatementIO[A] = Applicative[PreparedStatementIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/ref.scala b/modules/free/src/main/scala/doobie/free/ref.scala index c7dbdc988..a150c4796 100644 --- a/modules/free/src/main/scala/doobie/free/ref.scala +++ b/modules/free/src/main/scala/doobie/free/ref.scala @@ -197,6 +197,6 @@ object ref { module => implicit def SemigroupRefIO[A : Semigroup]: Semigroup[RefIO[A]] = new Semigroup[RefIO[A]] { override def combine(x: RefIO[A], y: RefIO[A]): RefIO[A] = Applicative[RefIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/resultset.scala b/modules/free/src/main/scala/doobie/free/resultset.scala index 57bc94a28..2198cb346 100644 --- a/modules/free/src/main/scala/doobie/free/resultset.scala +++ b/modules/free/src/main/scala/doobie/free/resultset.scala @@ -1152,6 +1152,6 @@ object resultset { module => implicit def SemigroupResultSetIO[A : Semigroup]: Semigroup[ResultSetIO[A]] = new Semigroup[ResultSetIO[A]] { override def combine(x: ResultSetIO[A], y: ResultSetIO[A]): ResultSetIO[A] = Applicative[ResultSetIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/sqldata.scala b/modules/free/src/main/scala/doobie/free/sqldata.scala index f0de890d3..a957ca04c 100644 --- a/modules/free/src/main/scala/doobie/free/sqldata.scala +++ b/modules/free/src/main/scala/doobie/free/sqldata.scala @@ -194,6 +194,6 @@ object sqldata { module => implicit def SemigroupSQLDataIO[A : Semigroup]: Semigroup[SQLDataIO[A]] = new Semigroup[SQLDataIO[A]] { override def combine(x: SQLDataIO[A], y: SQLDataIO[A]): SQLDataIO[A] = Applicative[SQLDataIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/sqlinput.scala b/modules/free/src/main/scala/doobie/free/sqlinput.scala index ef718046e..d0a1b6cf7 100644 --- a/modules/free/src/main/scala/doobie/free/sqlinput.scala +++ b/modules/free/src/main/scala/doobie/free/sqlinput.scala @@ -332,6 +332,6 @@ object sqlinput { module => implicit def SemigroupSQLInputIO[A : Semigroup]: Semigroup[SQLInputIO[A]] = new Semigroup[SQLInputIO[A]] { override def combine(x: SQLInputIO[A], y: SQLInputIO[A]): SQLInputIO[A] = Applicative[SQLInputIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/sqloutput.scala b/modules/free/src/main/scala/doobie/free/sqloutput.scala index 1897b3ba6..bab6c27e2 100644 --- a/modules/free/src/main/scala/doobie/free/sqloutput.scala +++ b/modules/free/src/main/scala/doobie/free/sqloutput.scala @@ -334,6 +334,6 @@ object sqloutput { module => implicit def SemigroupSQLOutputIO[A : Semigroup]: Semigroup[SQLOutputIO[A]] = new Semigroup[SQLOutputIO[A]] { override def combine(x: SQLOutputIO[A], y: SQLOutputIO[A]): SQLOutputIO[A] = Applicative[SQLOutputIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/free/src/main/scala/doobie/free/statement.scala b/modules/free/src/main/scala/doobie/free/statement.scala index e75ee19ba..2cfad30cb 100644 --- a/modules/free/src/main/scala/doobie/free/statement.scala +++ b/modules/free/src/main/scala/doobie/free/statement.scala @@ -461,6 +461,6 @@ object statement { module => implicit def SemigroupStatementIO[A : Semigroup]: Semigroup[StatementIO[A]] = new Semigroup[StatementIO[A]] { override def combine(x: StatementIO[A], y: StatementIO[A]): StatementIO[A] = Applicative[StatementIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/postgres/src/main/scala/doobie/postgres/free/copyin.scala b/modules/postgres/src/main/scala/doobie/postgres/free/copyin.scala index 2348214c7..a4620b340 100644 --- a/modules/postgres/src/main/scala/doobie/postgres/free/copyin.scala +++ b/modules/postgres/src/main/scala/doobie/postgres/free/copyin.scala @@ -227,6 +227,6 @@ object copyin { module => implicit def SemigroupCopyInIO[A : Semigroup]: Semigroup[CopyInIO[A]] = new Semigroup[CopyInIO[A]] { override def combine(x: CopyInIO[A], y: CopyInIO[A]): CopyInIO[A] = Applicative[CopyInIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/postgres/src/main/scala/doobie/postgres/free/copymanager.scala b/modules/postgres/src/main/scala/doobie/postgres/free/copymanager.scala index 1a22e0887..b76582c93 100644 --- a/modules/postgres/src/main/scala/doobie/postgres/free/copymanager.scala +++ b/modules/postgres/src/main/scala/doobie/postgres/free/copymanager.scala @@ -235,6 +235,6 @@ object copymanager { module => implicit def SemigroupCopyManagerIO[A : Semigroup]: Semigroup[CopyManagerIO[A]] = new Semigroup[CopyManagerIO[A]] { override def combine(x: CopyManagerIO[A], y: CopyManagerIO[A]): CopyManagerIO[A] = Applicative[CopyManagerIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/postgres/src/main/scala/doobie/postgres/free/copyout.scala b/modules/postgres/src/main/scala/doobie/postgres/free/copyout.scala index 04184e1ba..bd414b42c 100644 --- a/modules/postgres/src/main/scala/doobie/postgres/free/copyout.scala +++ b/modules/postgres/src/main/scala/doobie/postgres/free/copyout.scala @@ -216,6 +216,6 @@ object copyout { module => implicit def SemigroupCopyOutIO[A : Semigroup]: Semigroup[CopyOutIO[A]] = new Semigroup[CopyOutIO[A]] { override def combine(x: CopyOutIO[A], y: CopyOutIO[A]): CopyOutIO[A] = Applicative[CopyOutIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/postgres/src/main/scala/doobie/postgres/free/kleisliinterpreter.scala b/modules/postgres/src/main/scala/doobie/postgres/free/kleisliinterpreter.scala index f6164fbd6..42c588788 100644 --- a/modules/postgres/src/main/scala/doobie/postgres/free/kleisliinterpreter.scala +++ b/modules/postgres/src/main/scala/doobie/postgres/free/kleisliinterpreter.scala @@ -84,10 +84,10 @@ class KleisliInterpreter[M[_]](logHandler: LogHandler[M])(implicit val asyncM: W def forceR[G[_], J, A, B](interpreter: G ~> Kleisli[M, J, *])(fa: Free[G, A])(fb: Free[G, B]): Kleisli[M, J, B] = Kleisli (j => asyncM.forceR(fa.foldMap(interpreter).run(j))(fb.foldMap(interpreter).run(j)) ) - def uncancelable[G[_], J, A](interpreter: G ~> Kleisli[M, J, *], capture: Poll[M] => Poll[Free[G, *]])(body: Poll[Free[G, *]] => Free[G, A]): Kleisli[M, J, A] = Kleisli(j => + def uncancelable[G[_], J, A](interpreter: G ~> Kleisli[M, J, *], capture: Poll[M] => Poll[Free[G, *]])(body: Poll[Free[G, *]] => Free[G, A]): Kleisli[M, J, A] = Kleisli(j => asyncM.uncancelable(body.compose(capture).andThen(_.foldMap(interpreter).run(j))) ) - def poll[G[_], J, A](interpreter: G ~> Kleisli[M, J, *])(mpoll: Any, fa: Free[G, A]): Kleisli[M, J, A] = Kleisli(j => + def poll[G[_], J, A](interpreter: G ~> Kleisli[M, J, *])(mpoll: Any, fa: Free[G, A]): Kleisli[M, J, A] = Kleisli(j => mpoll.asInstanceOf[Poll[M]].apply(fa.foldMap(interpreter).run(j)) ) def onCancel[G[_], J, A](interpreter: G ~> Kleisli[M, J, *])(fa: Free[G, A], fin: Free[G, Unit]): Kleisli[M, J, A] = Kleisli (j => diff --git a/modules/postgres/src/main/scala/doobie/postgres/free/largeobject.scala b/modules/postgres/src/main/scala/doobie/postgres/free/largeobject.scala index 65d459f9f..e175e935f 100644 --- a/modules/postgres/src/main/scala/doobie/postgres/free/largeobject.scala +++ b/modules/postgres/src/main/scala/doobie/postgres/free/largeobject.scala @@ -284,6 +284,6 @@ object largeobject { module => implicit def SemigroupLargeObjectIO[A : Semigroup]: Semigroup[LargeObjectIO[A]] = new Semigroup[LargeObjectIO[A]] { override def combine(x: LargeObjectIO[A], y: LargeObjectIO[A]): LargeObjectIO[A] = Applicative[LargeObjectIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/postgres/src/main/scala/doobie/postgres/free/largeobjectmanager.scala b/modules/postgres/src/main/scala/doobie/postgres/free/largeobjectmanager.scala index 6c625ec39..5bb10e26e 100644 --- a/modules/postgres/src/main/scala/doobie/postgres/free/largeobjectmanager.scala +++ b/modules/postgres/src/main/scala/doobie/postgres/free/largeobjectmanager.scala @@ -227,6 +227,6 @@ object largeobjectmanager { module => implicit def SemigroupLargeObjectManagerIO[A : Semigroup]: Semigroup[LargeObjectManagerIO[A]] = new Semigroup[LargeObjectManagerIO[A]] { override def combine(x: LargeObjectManagerIO[A], y: LargeObjectManagerIO[A]): LargeObjectManagerIO[A] = Applicative[LargeObjectManagerIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/postgres/src/main/scala/doobie/postgres/free/pgconnection.scala b/modules/postgres/src/main/scala/doobie/postgres/free/pgconnection.scala index 0ab6f2424..360d3ec17 100644 --- a/modules/postgres/src/main/scala/doobie/postgres/free/pgconnection.scala +++ b/modules/postgres/src/main/scala/doobie/postgres/free/pgconnection.scala @@ -300,6 +300,6 @@ object pgconnection { module => implicit def SemigroupPGConnectionIO[A : Semigroup]: Semigroup[PGConnectionIO[A]] = new Semigroup[PGConnectionIO[A]] { override def combine(x: PGConnectionIO[A], y: PGConnectionIO[A]): PGConnectionIO[A] = Applicative[PGConnectionIO].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - } + } } diff --git a/modules/weaver/src/test/scala/doobie/weaver/CheckerTests.scala b/modules/weaver/src/test/scala/doobie/weaver/CheckerTests.scala index 43989044a..66fe273b1 100644 --- a/modules/weaver/src/test/scala/doobie/weaver/CheckerTests.scala +++ b/modules/weaver/src/test/scala/doobie/weaver/CheckerTests.scala @@ -20,7 +20,8 @@ object CheckerTests extends IOSuite with IOChecker { url = "jdbc:h2:mem:queryspec;DB_CLOSE_DELAY=-1", user = "sa", password = "", - logHandler = None + logHandler = + None )) test("trivial") { implicit transactor => diff --git a/project/FreeGen2.scala b/project/FreeGen2.scala index c5546d7aa..3f8c6de8e 100644 --- a/project/FreeGen2.scala +++ b/project/FreeGen2.scala @@ -423,7 +423,7 @@ class FreeGen2( | implicit def Semigroup$ioname[A : Semigroup]: Semigroup[$ioname[A]] = new Semigroup[$ioname[A]] { | override def combine(x: $ioname[A], y: $ioname[A]): $ioname[A] = | Applicative[$ioname].product(x, y).map { case (x, y) => Semigroup[A].combine(x, y) } - | } + | } |} |""".trim.stripMargin } @@ -587,10 +587,10 @@ class FreeGen2( | def forceR[G[_], J, A, B](interpreter: G ~> Kleisli[M, J, *])(fa: Free[G, A])(fb: Free[G, B]): Kleisli[M, J, B] = Kleisli (j => | asyncM.forceR(fa.foldMap(interpreter).run(j))(fb.foldMap(interpreter).run(j)) | ) - | def uncancelable[G[_], J, A](interpreter: G ~> Kleisli[M, J, *], capture: Poll[M] => Poll[Free[G, *]])(body: Poll[Free[G, *]] => Free[G, A]): Kleisli[M, J, A] = Kleisli(j => + | def uncancelable[G[_], J, A](interpreter: G ~> Kleisli[M, J, *], capture: Poll[M] => Poll[Free[G, *]])(body: Poll[Free[G, *]] => Free[G, A]): Kleisli[M, J, A] = Kleisli(j => | asyncM.uncancelable(body.compose(capture).andThen(_.foldMap(interpreter).run(j))) | ) - | def poll[G[_], J, A](interpreter: G ~> Kleisli[M, J, *])(mpoll: Any, fa: Free[G, A]): Kleisli[M, J, A] = Kleisli(j => + | def poll[G[_], J, A](interpreter: G ~> Kleisli[M, J, *])(mpoll: Any, fa: Free[G, A]): Kleisli[M, J, A] = Kleisli(j => | mpoll.asInstanceOf[Poll[M]].apply(fa.foldMap(interpreter).run(j)) | ) | def onCancel[G[_], J, A](interpreter: G ~> Kleisli[M, J, *])(fa: Free[G, A], fin: Free[G, Unit]): Kleisli[M, J, A] = Kleisli (j => From 74b61227a0b0bdcedf61dd4d4fea1a2417bf2b3a Mon Sep 17 00:00:00 2001 From: Jacob Wang Date: Sat, 1 Feb 2025 20:16:46 +0000 Subject: [PATCH 2/2] Add .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4d0bae78b..aea7d7dfb 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -3,3 +3,6 @@ 8c04f656ec5e21d6142ebde4539a00003b27a499 f6e03013f4c4a29074f528ac468129bdd2df63d3 13d6c997bb231bbae2bb1a9427d0fc4eb226e853 + +# Upgrade to scalafmt 3.8.6 +1c373a90e8fd788b666b037150e8912427708726