Skip to content

Commit b82f688

Browse files
authored
Update scalafmt-core to 3.0.1
1 parent d154f65 commit b82f688

10 files changed

Lines changed: 103 additions & 103 deletions

File tree

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.0.0
1+
version = 3.0.1
22

33
style = defaultWithAlign
44
maxColumn = 100

fetch-debug/src/main/scala/debug.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ object debug {
3939
def firstRequest(r: Round): Option[Long] =
4040
for {
4141
aQuery <- r.queries.headOption
42-
firstR = r.queries.foldLeft(aQuery.start)({ case (acc, q) =>
42+
firstR = r.queries.foldLeft(aQuery.start) { case (acc, q) =>
4343
acc min q.start
44-
})
44+
}
4545
} yield firstR
4646

4747
def lastRequest(r: Round): Option[Long] =
4848
for {
4949
aQuery <- r.queries.headOption
50-
lastR = r.queries.foldLeft(aQuery.end)({ case (acc, q) =>
50+
lastR = r.queries.foldLeft(aQuery.end) { case (acc, q) =>
5151
acc max q.end
52-
})
52+
}
5353
} yield lastR
5454

5555
def showLog(log: Log): Document =

fetch-examples/src/test/scala/GithubExample.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ class GithubExample extends AnyWordSpec with Matchers {
197197
case class Project(repo: Repo, contributors: List[Contributor], languages: List[Language])
198198

199199
def fetchProject[F[_]: Async](repo: Repo): Fetch[F, Project] =
200-
(repoContributors(repo), repoLanguages(repo)).mapN({ case (contribs, langs) =>
200+
(repoContributors(repo), repoLanguages(repo)).mapN { case (contribs, langs) =>
201201
Project(repo = repo, contributors = contribs, languages = langs)
202-
})
202+
}
203203

204204
def fetchOrg[F[_]: Async](org: String) =
205205
for {

fetch-examples/src/test/scala/GraphQLExample.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,19 @@ class GraphQLExample extends AnyWordSpec with Matchers {
232232

233233
object Parsers {
234234
def queryParser: Parser[OrganizationQuery] =
235-
rawParser.map({ case (o, n) =>
235+
rawParser.map { case (o, n) =>
236236
OrganizationQuery(
237237
o,
238-
n.map({ case (i, name, langs, colls) =>
238+
n.map { case (i, name, langs, colls) =>
239239
RepositoriesQuery(
240240
i,
241241
if (name) Some(()) else None,
242242
if (langs) Some(LanguagesQuery()) else None,
243243
if (colls) Some(CollaboratorsQuery()) else None
244244
)
245-
})
245+
}
246246
)
247-
})
247+
}
248248

249249
def rawParser: Parser[(String, Option[(Int, Boolean, Boolean, Boolean)])] =
250250
for {

fetch-examples/src/test/scala/JedisExample.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,26 +96,26 @@ object Binary {
9696
): F[ByteArray] = {
9797
byteOutputStream
9898
.mproduct(outputStream(_))
99-
.use({ case (byte, out) =>
99+
.use { case (byte, out) =>
100100
S.delay {
101101
out.writeObject(obj)
102102
out.flush()
103103
byte.toByteArray
104104
}
105-
})
105+
}
106106
}
107107

108108
def deserialize[F[_], A](bin: ByteArray)(implicit
109109
S: Sync[F]
110110
): F[Option[A]] = {
111111
byteInputStream(bin)
112112
.mproduct(inputStream(_))
113-
.use({ case (byte, in) =>
113+
.use { case (byte, in) =>
114114
S.delay {
115115
val obj = in.readObject()
116116
Try(obj.asInstanceOf[A]).toOption
117117
}
118-
})
118+
}
119119
}
120120
}
121121

@@ -159,9 +159,9 @@ case class RedisCache[F[_]: Sync](host: String) extends DataCache[F] {
159159
M: Monad[F]
160160
): F[DataCache[F]] =
161161
for {
162-
bin <- vs.traverse({ case (id, v) =>
162+
bin <- vs.traverse { case (id, v) =>
163163
Binary.serialize(v).tupleRight(cacheId(id, data))
164-
})
164+
}
165165
_ <- Sync[F].delay(bulkSet(bin))
166166
} yield this
167167

fetch/src/main/scala/cache.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ object InMemoryCache {
7070
InMemoryCache[F](Map.empty[(Data[Any, Any], DataSourceId), DataSourceResult])
7171

7272
def from[F[_]: Monad, I, A](results: ((Data[I, A], I), A)*): InMemoryCache[F] =
73-
InMemoryCache[F](results.foldLeft(Map.empty[(Data[Any, Any], DataSourceId), DataSourceResult])({
73+
InMemoryCache[F](results.foldLeft(Map.empty[(Data[Any, Any], DataSourceId), DataSourceResult]) {
7474
case (acc, ((data, i), v)) =>
7575
acc.updated(
7676
(data.asInstanceOf[Data[Any, Any]], new DataSourceId(i)),
7777
new DataSourceResult(v)
7878
)
79-
}))
79+
})
8080
}

fetch/src/main/scala/fetch.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ object `package` {
240240
.get(dsId)
241241
.fold(
242242
(ds, blocked)
243-
)({ case (d, req) =>
243+
) { case (d, req) =>
244244
(d, combineRequests(blocked, req))
245-
})
245+
}
246246
acc.updated(dsId, combined)
247247
}
248248
)
@@ -601,9 +601,9 @@ object `package` {
601601
requests <- FetchExecution.parallel(
602602
NonEmptyList
603603
.fromListUnsafe(blocked)
604-
.map({ case (ds, req) =>
604+
.map { case (ds, req) =>
605605
runBlockedRequest(req, ds, cache, log)
606-
})
606+
}
607607
)
608608
performedRequests = requests.foldLeft(List.empty[Request])(_ ++ _)
609609
_ <-

fetch/src/test/scala/FetchBatchingTests.scala

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ class FetchBatchingTests extends FetchSpec {
109109

110110
val io = Fetch.runLog[IO](fetch)
111111

112-
io.map({ case (log, result) =>
112+
io.map { case (log, result) =>
113113
result shouldEqual List(1, 2, 3, 4, 5)
114114
log.rounds.size shouldEqual 1
115115
totalFetched(log.rounds) shouldEqual 5
116116
totalBatches(log.rounds) shouldEqual 3
117-
}).unsafeToFuture()
117+
}.unsafeToFuture()
118118
}
119119

120120
"A large fetch to a datasource with a maximum batch size is split and executed in parallel" in {
@@ -123,12 +123,12 @@ class FetchBatchingTests extends FetchSpec {
123123

124124
val io = Fetch.runLog[IO](fetch)
125125

126-
io.map({ case (log, result) =>
126+
io.map { case (log, result) =>
127127
result shouldEqual List(1, 2, 3, 4, 5)
128128
log.rounds.size shouldEqual 1
129129
totalFetched(log.rounds) shouldEqual 5
130130
totalBatches(log.rounds) shouldEqual 3
131-
}).unsafeToFuture()
131+
}.unsafeToFuture()
132132
}
133133

134134
"Fetches to datasources with a maximum batch size should be split and executed in parallel and sequentially when using productR" in {
@@ -138,12 +138,12 @@ class FetchBatchingTests extends FetchSpec {
138138

139139
val io = Fetch.runLog[IO](fetch)
140140

141-
io.map({ case (log, result) =>
141+
io.map { case (log, result) =>
142142
result shouldEqual List(1, 2, 3, 4, 5)
143143
log.rounds.size shouldEqual 1
144144
totalFetched(log.rounds) shouldEqual 5 + 5
145145
totalBatches(log.rounds) shouldEqual 3 + 3
146-
}).unsafeToFuture()
146+
}.unsafeToFuture()
147147
}
148148

149149
"Fetches to datasources with a maximum batch size should be split and executed in parallel and sequentially when using productL" in {
@@ -153,12 +153,12 @@ class FetchBatchingTests extends FetchSpec {
153153

154154
val io = Fetch.runLog[IO](fetch)
155155

156-
io.map({ case (log, result) =>
156+
io.map { case (log, result) =>
157157
result shouldEqual List(1, 2, 3, 4, 5)
158158
log.rounds.size shouldEqual 1
159159
totalFetched(log.rounds) shouldEqual 5 + 5
160160
totalBatches(log.rounds) shouldEqual 3 + 3
161-
}).unsafeToFuture()
161+
}.unsafeToFuture()
162162
}
163163

164164
"A large (many) fetch to a datasource with a maximum batch size is split and executed in sequence" in {
@@ -167,12 +167,12 @@ class FetchBatchingTests extends FetchSpec {
167167

168168
val io = Fetch.runLog[IO](fetch)
169169

170-
io.map({ case (log, result) =>
170+
io.map { case (log, result) =>
171171
result shouldEqual List(1, 2, 3)
172172
log.rounds.size shouldEqual 1
173173
totalFetched(log.rounds) shouldEqual 3
174174
totalBatches(log.rounds) shouldEqual 2
175-
}).unsafeToFuture()
175+
}.unsafeToFuture()
176176
}
177177

178178
"A large (many) fetch to a datasource with a maximum batch size is split and executed in parallel" in {
@@ -181,12 +181,12 @@ class FetchBatchingTests extends FetchSpec {
181181

182182
val io = Fetch.runLog[IO](fetch)
183183

184-
io.map({ case (log, result) =>
184+
io.map { case (log, result) =>
185185
result shouldEqual List(1, 2, 3)
186186
log.rounds.size shouldEqual 1
187187
totalFetched(log.rounds) shouldEqual 3
188188
totalBatches(log.rounds) shouldEqual 2
189-
}).unsafeToFuture()
189+
}.unsafeToFuture()
190190
}
191191

192192
"Very deep fetches don't overflow stack or heap" in {
@@ -203,8 +203,8 @@ class FetchBatchingTests extends FetchSpec {
203203
ids.toList.traverse(fetchBatchedDataBigId[IO])
204204
)
205205

206-
io.map({ case (log, result) =>
206+
io.map { case (log, result) =>
207207
result shouldEqual ids.map(_.toString)
208-
}).unsafeToFuture()
208+
}.unsafeToFuture()
209209
}
210210
}

fetch/src/test/scala/FetchReportingTests.scala

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class FetchReportingTests extends FetchSpec {
2929

3030
val io = Fetch.runLog[IO](fetch)
3131

32-
io.map({ case (log, result) =>
32+
io.map { case (log, result) =>
3333
log.rounds.size shouldEqual 0
34-
}).unsafeToFuture()
34+
}.unsafeToFuture()
3535
}
3636

3737
"Single fetches are executed in one round" in {
@@ -40,9 +40,9 @@ class FetchReportingTests extends FetchSpec {
4040

4141
val io = Fetch.runLog[IO](fetch[IO])
4242

43-
io.map({ case (log, result) =>
43+
io.map { case (log, result) =>
4444
log.rounds.size shouldEqual 1
45-
}).unsafeToFuture()
45+
}.unsafeToFuture()
4646
}
4747

4848
"Single fetches are executed in one round per binding in a for comprehension" in {
@@ -54,9 +54,9 @@ class FetchReportingTests extends FetchSpec {
5454

5555
val io = Fetch.runLog[IO](fetch)
5656

57-
io.map({ case (log, result) =>
57+
io.map { case (log, result) =>
5858
log.rounds.size shouldEqual 2
59-
}).unsafeToFuture()
59+
}.unsafeToFuture()
6060
}
6161

6262
"Single fetches for different data sources are executed in multiple rounds if they are in a for comprehension" in {
@@ -68,9 +68,9 @@ class FetchReportingTests extends FetchSpec {
6868

6969
val io = Fetch.runLog[IO](fetch)
7070

71-
io.map({ case (log, result) =>
71+
io.map { case (log, result) =>
7272
log.rounds.size shouldEqual 2
73-
}).unsafeToFuture()
73+
}.unsafeToFuture()
7474
}
7575

7676
"Single fetches combined with cartesian are run in one round" in {
@@ -79,9 +79,9 @@ class FetchReportingTests extends FetchSpec {
7979

8080
val io = Fetch.runLog[IO](fetch)
8181

82-
io.map({ case (log, result) =>
82+
io.map { case (log, result) =>
8383
log.rounds.size shouldEqual 1
84-
}).unsafeToFuture()
84+
}.unsafeToFuture()
8585
}
8686

8787
"Single fetches combined with traverse are run in one round" in {
@@ -93,9 +93,9 @@ class FetchReportingTests extends FetchSpec {
9393

9494
val io = Fetch.runLog[IO](fetch)
9595

96-
io.map({ case (log, result) =>
96+
io.map { case (log, result) =>
9797
log.rounds.size shouldEqual 2
98-
}).unsafeToFuture()
98+
}.unsafeToFuture()
9999
}
100100

101101
"The product of two fetches from the same data source implies batching" in {
@@ -104,9 +104,9 @@ class FetchReportingTests extends FetchSpec {
104104

105105
val io = Fetch.runLog[IO](fetch)
106106

107-
io.map({ case (log, result) =>
107+
io.map { case (log, result) =>
108108
log.rounds.size shouldEqual 1
109-
}).unsafeToFuture()
109+
}.unsafeToFuture()
110110
}
111111

112112
"The product of concurrent fetches of the same type implies everything fetched in batches" in {
@@ -129,10 +129,10 @@ class FetchReportingTests extends FetchSpec {
129129

130130
val io = Fetch.runLog[IO](fetch)
131131

132-
io.map({ case (log, result) =>
132+
io.map { case (log, result) =>
133133
log.rounds.size shouldEqual 2
134134
totalBatches(log.rounds) shouldEqual 1
135135
totalFetched(log.rounds) shouldEqual 3 + 1
136-
}).unsafeToFuture()
136+
}.unsafeToFuture()
137137
}
138138
}

0 commit comments

Comments
 (0)