Skip to content

Commit 2356551

Browse files
committed
Prevent indentation warnings on Scala 3.
1 parent 88bd111 commit 2356551

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

build.sc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ trait ScalaSql extends Common{
6767
def forkArgs = Seq("-Duser.timezone=Asia/Singapore")
6868
}
6969

70+
private def indent(code: Iterable[String]): String =
71+
code.map(_.split("\n").map(" " + _).mkString("\n")).mkString("\n")
72+
7073
object core extends Common with CrossValue {
7174
def ivyDeps = Agg(
7275
ivy"com.lihaoyi::geny:1.0.0",
@@ -101,7 +104,7 @@ trait ScalaSql extends Common{
101104
s"""package scalasql.core.generated
102105
|import scalasql.core.Queryable
103106
|trait QueryableRow{
104-
| ${queryableRowDefs.mkString("\n")}
107+
|${indent(queryableRowDefs)}
105108
|}
106109
|""".stripMargin
107110
)
@@ -180,23 +183,23 @@ trait ScalaSql extends Common{
180183
|import scalasql.core.{Queryable, Expr}
181184
|import scalasql.query.Column
182185
|trait Insert[V[_[_]], R]{
183-
| ${defs(false).mkString("\n")}
186+
|${indent(defs(false))}
184187
|}
185188
|trait InsertImpl[V[_[_]], R] extends Insert[V, R]{ this: scalasql.query.Insert[V, R] =>
186189
| def newInsertValues[R](
187190
| insert: scalasql.query.Insert[V, R],
188191
| columns: Seq[Column[_]],
189192
| valuesLists: Seq[Seq[Expr[_]]]
190193
| )(implicit qr: Queryable[V[Column], R]): scalasql.query.InsertColumns[V, R]
191-
| ${defs(true).mkString("\n")}
194+
|${indent(defs(true))}
192195
|}
193196
|
194197
|trait QueryableRow{
195-
| ${queryableRowDefs.mkString("\n")}
198+
|${indent(queryableRowDefs)}
196199
|}
197200
|
198201
|trait JoinAppend extends scalasql.query.JoinAppendLowPriority{
199-
| ${joinAppendDefs.mkString("\n")}
202+
|${indent(joinAppendDefs)}
200203
|}
201204
|""".stripMargin
202205
)

0 commit comments

Comments
 (0)