Skip to content

Commit 3f58dc0

Browse files
committed
Update scalafmt setting
use new syntax. prepare Scala 3.4
1 parent 1a9e85c commit 3f58dc0

File tree

3 files changed

+48
-38
lines changed

3 files changed

+48
-38
lines changed

.scalafmt.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,13 @@ newlines.topLevelStatementBlankLines = [
2424
}
2525
]
2626
project.layout = StandardConvention
27+
fileOverride {
28+
"glob:**/*.sbt" {
29+
runner.dialect = scala212
30+
rewrite.scala3.convertToNewSyntax = false
31+
}
32+
}
33+
rewrite.scala3.convertToNewSyntax = true
34+
runner.dialectOverride.allowSignificantIndentation = false
35+
runner.dialectOverride.allowAsForImportRename = false
36+
runner.dialectOverride.allowStarWildcardImport = false

src/main/scala-2/com/github/takezoe/slick/blocking/BlockingProfile.scala

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
5555
def run(implicit s: JdbcBackend#Session): E = invoker.first
5656
def selectStatement: String = invoker.selectStatement
5757
}
58-
implicit class QueryExecutor[U, C[_]](q: Query[_, U, C]) {
58+
implicit class QueryExecutor[U, C[_]](q: Query[?, U, C]) {
5959
private val invoker = new QueryInvoker[U](queryCompiler.run(q.toNode).tree, ())
6060

6161
def run(implicit s: JdbcBackend#Session): Seq[U] = invoker.results(0).right.get.toSeq
6262
def selectStatement: String = invoker.selectStatement
6363
}
6464

65-
implicit class RunnableCompiledQueryExecutor[U, C[_]](c: RunnableCompiled[_ <: Query[_, _, C], C[U]]) {
65+
implicit class RunnableCompiledQueryExecutor[U, C[_]](c: RunnableCompiled[? <: Query[?, ?, C], C[U]]) {
6666
private val invoker = new QueryInvoker[U](c.compiledQuery, c.param)
6767

6868
def run(implicit s: JdbcBackend#Session): Seq[U] = invoker.invoker.results(0).right.get.toSeq
@@ -106,10 +106,10 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
106106
invoker.results(0).right.get.foldLeft(z)(f)
107107
}
108108
}
109-
implicit def queryToQueryInvoker[U, C[_]](q: Query[_, U, C]): BlockingQueryInvoker[U] =
109+
implicit def queryToQueryInvoker[U, C[_]](q: Query[?, U, C]): BlockingQueryInvoker[U] =
110110
new BlockingQueryInvoker[U](queryCompiler.run(q.toNode).tree, ())
111111
implicit def compiledToQueryInvoker[U, C[_]](
112-
c: RunnableCompiled[_ <: Query[_, _, C], C[U]]
112+
c: RunnableCompiled[? <: Query[?, ?, C], C[U]]
113113
): BlockingQueryInvoker[U] =
114114
new BlockingQueryInvoker[U](c.compiledQuery, c.param)
115115

@@ -124,10 +124,10 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
124124

125125
def deleteInvoker: this.type = this
126126
}
127-
implicit def queryToDeleteInvoker[U, C[_]](q: Query[_, U, C]): BlockingDeleteInvoker =
127+
implicit def queryToDeleteInvoker[U, C[_]](q: Query[?, U, C]): BlockingDeleteInvoker =
128128
new BlockingDeleteInvoker(deleteCompiler.run(q.toNode).tree, ())
129129
implicit def compiledToDeleteInvoker[U, C[_]](
130-
c: RunnableCompiled[_ <: Query[_, _, C], C[U]]
130+
c: RunnableCompiled[? <: Query[?, ?, C], C[U]]
131131
): BlockingDeleteInvoker =
132132
new BlockingDeleteInvoker(c.compiledDelete, c.param)
133133

@@ -142,10 +142,10 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
142142
invoker.results(0).right.get.toMap
143143
}
144144
}
145-
implicit def mapInvoker[A, B, C[_]](q: Query[_, (A, B), C]): MapInvoker[A, B] =
145+
implicit def mapInvoker[A, B, C[_]](q: Query[?, (A, B), C]): MapInvoker[A, B] =
146146
new MapInvoker[A, B](queryCompiler.run(q.toNode).tree, ())
147147
implicit def compiledMapInvoker[A, B, C[_]](
148-
c: RunnableCompiled[_ <: Query[_, _, C], C[(A, B)]]
148+
c: RunnableCompiled[? <: Query[?, ?, C], C[(A, B)]]
149149
): MapInvoker[A, B] =
150150
new MapInvoker[A, B](c.compiledQuery, c.param)
151151

@@ -161,10 +161,10 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
161161

162162
def updateInvoker: this.type = this
163163
}
164-
implicit def queryToUpdateInvoker[U, C[_]](q: Query[_, U, C]): BlockingUpdateInvoker[U] =
164+
implicit def queryToUpdateInvoker[U, C[_]](q: Query[?, U, C]): BlockingUpdateInvoker[U] =
165165
new BlockingUpdateInvoker[U](updateCompiler.run(q.toNode).tree, ())
166166
implicit def compiledToUpdateInvoker[U, C[_]](
167-
c: RunnableCompiled[_ <: Query[_, _, C], C[U]]
167+
c: RunnableCompiled[? <: Query[?, ?, C], C[U]]
168168
): BlockingUpdateInvoker[U] =
169169
new BlockingUpdateInvoker[U](c.compiledUpdate, c.param)
170170

@@ -198,10 +198,10 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
198198

199199
def insertInvoker: this.type = this
200200
}
201-
implicit def queryToInsertInvoker[U, C[_]](q: Query[_, U, C]): BlockingInsertInvoker[U] =
201+
implicit def queryToInsertInvoker[U, C[_]](q: Query[?, U, C]): BlockingInsertInvoker[U] =
202202
new BlockingInsertInvoker[U](compileInsert(q.toNode))
203203
implicit def compiledToInsertInvoker[U, C[_]](
204-
c: RunnableCompiled[_ <: Query[_, _, C], C[U]]
204+
c: RunnableCompiled[? <: Query[?, ?, C], C[U]]
205205
): BlockingInsertInvoker[U] =
206206
new BlockingInsertInvoker[U](c.compiledInsert.asInstanceOf[CompiledInsert])
207207

@@ -211,7 +211,7 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
211211

212212
def insert(value: T)(implicit s: JdbcBackend#Session): R = {
213213
(a += value) match {
214-
case a: SynchronousDatabaseAction[R, _, JdbcBackend, _] @unchecked => {
214+
case a: SynchronousDatabaseAction[R, ?, JdbcBackend, ?] @unchecked => {
215215
a.run(new BlockingJdbcActionContext(s))
216216
}
217217
}
@@ -221,7 +221,7 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
221221

222222
def insertAll(values: T*)(implicit s: JdbcBackend#Session): Seq[R] = {
223223
(a ++= values) match {
224-
case a: SynchronousDatabaseAction[Seq[R], _, JdbcBackend, _] @unchecked => {
224+
case a: SynchronousDatabaseAction[Seq[R], ?, JdbcBackend, ?] @unchecked => {
225225
a.run(new BlockingJdbcActionContext(s))
226226
}
227227
}
@@ -234,7 +234,7 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
234234

235235
def insert(value: T)(implicit s: JdbcBackend#Session): R = {
236236
(a += value) match {
237-
case a: SynchronousDatabaseAction[R, _, JdbcBackend, _] @unchecked => {
237+
case a: SynchronousDatabaseAction[R, ?, JdbcBackend, ?] @unchecked => {
238238
a.run(new BlockingJdbcActionContext(s))
239239
}
240240
}
@@ -244,7 +244,7 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
244244

245245
def insertAll(values: T*)(implicit s: JdbcBackend#Session): Seq[R] = {
246246
(a ++= values) match {
247-
case a: SynchronousDatabaseAction[Seq[R], _, JdbcBackend, _] @unchecked => {
247+
case a: SynchronousDatabaseAction[Seq[R], ?, JdbcBackend, ?] @unchecked => {
248248
a.run(new BlockingJdbcActionContext(s))
249249
}
250250
}
@@ -308,7 +308,7 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
308308
streaming: Boolean,
309309
topLevel: Boolean
310310
): T = action match {
311-
case a: SynchronousDatabaseAction[_, _, JdbcBackend, Effect] => a.run(ctx).asInstanceOf[T]
311+
case a: SynchronousDatabaseAction[?, ?, JdbcBackend, Effect] => a.run(ctx).asInstanceOf[T]
312312
case FlatMapAction(base, f, ec) =>
313313
val result = executeAction(base, ctx, false, topLevel)
314314
executeAction(f(result), ctx, streaming, false)

src/main/scala-3/com/github/takezoe/slick/blocking/BlockingProfile.scala

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import slick.lifted.RunnableCompiled
1212
import slick.relational.*
1313
import scala.language.existentials
1414
import scala.language.implicitConversions
15-
import scala.util._
15+
import scala.util.*
1616

1717
trait BlockingRelationalProfile extends RelationalProfile {
1818
trait BlockingAPI extends RelationalAPI {}
@@ -54,14 +54,14 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
5454
def run(implicit s: JdbcBackend#Session): E = invoker.first
5555
def selectStatement: String = invoker.selectStatement
5656
}
57-
implicit class QueryExecutor[U, C[_]](q: Query[_, U, C]) {
57+
implicit class QueryExecutor[U, C[_]](q: Query[?, U, C]) {
5858
private val invoker = new QueryInvoker[U](queryCompiler.run(q.toNode).tree, ())
5959

6060
def run(implicit s: JdbcBackend#Session): Seq[U] = invoker.results(0).right.get.toSeq
6161
def selectStatement: String = invoker.selectStatement
6262
}
6363

64-
implicit class RunnableCompiledQueryExecutor[U, C[_]](c: RunnableCompiled[_ <: Query[_, _, C], C[U]]) {
64+
implicit class RunnableCompiledQueryExecutor[U, C[_]](c: RunnableCompiled[? <: Query[_, _, C], C[U]]) {
6565
private val invoker = new QueryInvoker[U](c.compiledQuery, c.param)
6666

6767
def run(implicit s: JdbcBackend#Session): Seq[U] = invoker.invoker.results(0).right.get.toSeq
@@ -105,10 +105,10 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
105105
invoker.results(0).right.get.foldLeft(z)(f)
106106
}
107107
}
108-
implicit def queryToQueryInvoker[U, C[_]](q: Query[_, U, C]): BlockingQueryInvoker[U] =
108+
implicit def queryToQueryInvoker[U, C[_]](q: Query[?, U, C]): BlockingQueryInvoker[U] =
109109
new BlockingQueryInvoker[U](queryCompiler.run(q.toNode).tree, ())
110110
implicit def compiledToQueryInvoker[U, C[_]](
111-
c: RunnableCompiled[_ <: Query[_, _, C], C[U]]
111+
c: RunnableCompiled[? <: Query[_, _, C], C[U]]
112112
): BlockingQueryInvoker[U] =
113113
new BlockingQueryInvoker[U](c.compiledQuery, c.param)
114114

@@ -123,10 +123,10 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
123123

124124
def deleteInvoker: this.type = this
125125
}
126-
implicit def queryToDeleteInvoker[U, C[_]](q: Query[_, U, C]): BlockingDeleteInvoker =
126+
implicit def queryToDeleteInvoker[U, C[_]](q: Query[?, U, C]): BlockingDeleteInvoker =
127127
new BlockingDeleteInvoker(deleteCompiler.run(q.toNode).tree, ())
128128
implicit def compiledToDeleteInvoker[U, C[_]](
129-
c: RunnableCompiled[_ <: Query[_, _, C], C[U]]
129+
c: RunnableCompiled[? <: Query[_, _, C], C[U]]
130130
): BlockingDeleteInvoker =
131131
new BlockingDeleteInvoker(c.compiledDelete, c.param)
132132

@@ -142,11 +142,11 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
142142
}
143143
}
144144

145-
implicit def mapInvoker[A, B, C[_]](q: Query[_, (A, B), C]): MapInvoker[A, B] =
145+
implicit def mapInvoker[A, B, C[_]](q: Query[?, (A, B), C]): MapInvoker[A, B] =
146146
new MapInvoker[A, B](queryCompiler.run(q.toNode).tree, ())
147147

148148
implicit def compiledMapInvoker[A, B, C[_]](
149-
c: RunnableCompiled[_ <: Query[_, _, C], C[(A, B)]]
149+
c: RunnableCompiled[? <: Query[_, _, C], C[(A, B)]]
150150
): MapInvoker[A, B] =
151151
new MapInvoker[A, B](c.compiledQuery, c.param)
152152

@@ -162,10 +162,10 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
162162

163163
def updateInvoker: this.type = this
164164
}
165-
implicit def queryToUpdateInvoker[U, C[_]](q: Query[_, U, C]): BlockingUpdateInvoker[U] =
165+
implicit def queryToUpdateInvoker[U, C[_]](q: Query[?, U, C]): BlockingUpdateInvoker[U] =
166166
new BlockingUpdateInvoker[U](updateCompiler.run(q.toNode).tree, ())
167167
implicit def compiledToUpdateInvoker[U, C[_]](
168-
c: RunnableCompiled[_ <: Query[_, _, C], C[U]]
168+
c: RunnableCompiled[? <: Query[_, _, C], C[U]]
169169
): BlockingUpdateInvoker[U] =
170170
new BlockingUpdateInvoker[U](c.compiledUpdate, c.param)
171171

@@ -180,7 +180,7 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
180180
.run(new BlockingJdbcActionContext(s))
181181
}
182182

183-
def ++=(values: Iterable[U])(implicit s: JdbcBackend#Session): Int = insertAll(values.toSeq: _*)
183+
def ++=(values: Iterable[U])(implicit s: JdbcBackend#Session): Int = insertAll(values.toSeq*)
184184

185185
def insertAll(values: U*)(implicit s: JdbcBackend#Session): Int = {
186186
createInsertActionExtensionMethods(compiled)
@@ -199,10 +199,10 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
199199

200200
def insertInvoker: this.type = this
201201
}
202-
implicit def queryToInsertInvoker[U, C[_]](q: Query[_, U, C]): BlockingInsertInvoker[U] =
202+
implicit def queryToInsertInvoker[U, C[_]](q: Query[?, U, C]): BlockingInsertInvoker[U] =
203203
new BlockingInsertInvoker[U](compileInsert(q.toNode))
204204
implicit def compiledToInsertInvoker[U, C[_]](
205-
c: RunnableCompiled[_ <: Query[_, _, C], C[U]]
205+
c: RunnableCompiled[? <: Query[_, _, C], C[U]]
206206
): BlockingInsertInvoker[U] =
207207
new BlockingInsertInvoker[U](c.compiledInsert.asInstanceOf[CompiledInsert])
208208

@@ -212,17 +212,17 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
212212

213213
def insert(value: T)(implicit s: JdbcBackend#Session): R = {
214214
(a += value) match {
215-
case a: SynchronousDatabaseAction[R, _, BlockingJdbcActionContext, ?, _] @unchecked => {
215+
case a: SynchronousDatabaseAction[R, ?, BlockingJdbcActionContext, ?, ?] @unchecked => {
216216
a.run(new BlockingJdbcActionContext(s))
217217
}
218218
}
219219
}
220220

221-
def ++=(values: Iterable[T])(implicit s: JdbcBackend#Session): Seq[R] = insertAll(values.toSeq: _*)
221+
def ++=(values: Iterable[T])(implicit s: JdbcBackend#Session): Seq[R] = insertAll(values.toSeq*)
222222

223223
def insertAll(values: T*)(implicit s: JdbcBackend#Session): Seq[R] = {
224224
(a ++= values) match {
225-
case a: SynchronousDatabaseAction[Seq[R], _, BlockingJdbcActionContext, ?, _] @unchecked => {
225+
case a: SynchronousDatabaseAction[Seq[R], ?, BlockingJdbcActionContext, ?, ?] @unchecked => {
226226
a.run(new BlockingJdbcActionContext(s))
227227
}
228228
}
@@ -235,17 +235,17 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
235235

236236
def insert(value: T)(implicit s: JdbcBackend#Session): R = {
237237
(a += value) match {
238-
case a: SynchronousDatabaseAction[R, _, BlockingJdbcActionContext, ?, _] @unchecked => {
238+
case a: SynchronousDatabaseAction[R, ?, BlockingJdbcActionContext, ?, ?] @unchecked => {
239239
a.run(new BlockingJdbcActionContext(s))
240240
}
241241
}
242242
}
243243

244-
def ++=(values: Iterable[T])(implicit s: JdbcBackend#Session): Seq[R] = insertAll(values.toSeq: _*)
244+
def ++=(values: Iterable[T])(implicit s: JdbcBackend#Session): Seq[R] = insertAll(values.toSeq*)
245245

246246
def insertAll(values: T*)(implicit s: JdbcBackend#Session): Seq[R] = {
247247
(a ++= values) match {
248-
case a: SynchronousDatabaseAction[Seq[R], _, BlockingJdbcActionContext, ?, _] @unchecked => {
248+
case a: SynchronousDatabaseAction[Seq[R], ?, BlockingJdbcActionContext, ?, ?] @unchecked => {
249249
a.run(new BlockingJdbcActionContext(s))
250250
}
251251
}
@@ -309,7 +309,7 @@ trait BlockingJdbcProfile extends JdbcProfile with BlockingRelationalProfile {
309309
streaming: Boolean,
310310
topLevel: Boolean
311311
): T = action match {
312-
case a: SynchronousDatabaseAction[_, _, backend.JdbcActionContext, _, Effect] => a.run(ctx).asInstanceOf[T]
312+
case a: SynchronousDatabaseAction[?, ?, backend.JdbcActionContext, ?, Effect] => a.run(ctx).asInstanceOf[T]
313313
case FlatMapAction(base, f, ec) =>
314314
val result = executeAction(base, ctx, false, topLevel)
315315
executeAction(f(result), ctx, streaming, false)

0 commit comments

Comments
 (0)