Skip to content

Commit 223a412

Browse files
committed
apply formatting from prePR
1 parent 32b809d commit 223a412

13 files changed

+59
-47
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ jobs:
8080

8181
- name: Make target directories
8282
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
83-
run: mkdir -p circe/jvm/target playJson/native/target testkit/native/target testkit/js/target core/.native/target playJson/jvm/target core/.js/target circe/js/target core/.jvm/target circe/native/target playJson/js/target testkit/jvm/target sprayJson/.jvm/target project/target
83+
run: mkdir -p ujson/jvm/target circe/jvm/target playJson/native/target testkit/native/target testkit/js/target core/.native/target playJson/jvm/target ujson/js/target core/.js/target circe/js/target core/.jvm/target circe/native/target ujson/native/target playJson/js/target testkit/jvm/target sprayJson/.jvm/target project/target
8484

8585
- name: Compress target directories
8686
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
87-
run: tar cf targets.tar circe/jvm/target playJson/native/target testkit/native/target testkit/js/target core/.native/target playJson/jvm/target core/.js/target circe/js/target core/.jvm/target circe/native/target playJson/js/target testkit/jvm/target sprayJson/.jvm/target project/target
87+
run: tar cf targets.tar ujson/jvm/target circe/jvm/target playJson/native/target testkit/native/target testkit/js/target core/.native/target playJson/jvm/target ujson/js/target core/.js/target circe/js/target core/.jvm/target circe/native/target ujson/native/target playJson/js/target testkit/jvm/target sprayJson/.jvm/target project/target
8888

8989
- name: Upload target directories
9090
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')

build.sbt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,11 @@ lazy val ujson = crossProject(JSPlatform, JVMPlatform, NativePlatform)
101101
name := "diffson-ujson",
102102
libraryDependencies ++= Seq(
103103
"com.lihaoyi" %%% "ujson" % ujsonVersion,
104-
"com.lihaoyi" %%% "upickle" % ujsonVersion,
104+
"com.lihaoyi" %%% "upickle" % ujsonVersion
105105
)
106106
)
107107
.dependsOn(core, testkit % Test)
108108

109-
110109
lazy val benchmarks = crossProject(JVMPlatform)
111110
.crossType(CrossType.Pure)
112111
.in(file("benchmarks"))
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
package diffson.ujson
1+
/*
2+
* Copyright 2022 Lucas Satabin
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
216

3-
case class FieldMissing(fieldName: String)
4-
extends Exception(s"Expected field `$fieldName`, but it is missing")
17+
package diffson
18+
package ujson
19+
20+
case class FieldMissing(fieldName: String) extends Exception(s"Expected field `$fieldName`, but it is missing")

ujson/shared/src/main/scala/diffson/ujson/package.scala

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Raphael Bosshard
2+
* Copyright 2022 Lucas Satabin
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,15 +20,14 @@ import cats.implicits._
2020
import diffson.jsonmergepatch.JsonMergePatch
2121
import diffson.jsonpatch._
2222
import diffson.jsonpointer.Pointer
23-
import _root_.ujson as lihaoyUjson
24-
import lihaoyUjson.{Value, Arr, Obj, Str}
23+
import _root_.ujson.{Value, Arr, Obj, Str}
2524
import upickle.default._
2625

2726
import scala.util.Try
2827

2928
package object ujson {
30-
31-
implicit val jsonyUjson: Jsony[Value] = new Jsony[Value] {
29+
30+
implicit val jsonyUjson: Jsony[Value] = new Jsony[Value] {
3231

3332
def Null: Value = _root_.ujson.Null
3433

@@ -64,49 +63,49 @@ package object ujson {
6463
Obj(
6564
"op" -> Str("add"),
6665
"path" -> Str(path.show),
67-
"value" -> value,
66+
"value" -> value
6867
)
6968
case Remove(path, Some(old)) =>
7069
Obj(
7170
"op" -> Str("remove"),
7271
"path" -> Str(path.show),
73-
"old" -> old,
72+
"old" -> old
7473
)
7574
case Remove(path, None) =>
7675
Obj(
7776
"op" -> Str("remove"),
78-
"path" -> Str(path.show),
77+
"path" -> Str(path.show)
7978
)
8079
case Replace(path, value, Some(old)) =>
8180
Obj(
8281
"op" -> Str("replace"),
8382
"path" -> Str(path.show),
8483
"value" -> value,
85-
"old" -> old,
84+
"old" -> old
8685
)
8786
case Replace(path, value, None) =>
8887
Obj(
8988
"op" -> Str("replace"),
9089
"path" -> Str(path.show),
91-
"value" -> value,
90+
"value" -> value
9291
)
9392
case Move(from, path) =>
9493
Obj(
9594
"op" -> Str("move"),
9695
"from" -> Str(from.show),
97-
"path" -> Str(path.show),
96+
"path" -> Str(path.show)
9897
)
9998
case Copy(from, path) =>
10099
Obj(
101100
"op" -> Str("copy"),
102101
"from" -> Str(from.show),
103-
"path" -> Str(path.show),
102+
"path" -> Str(path.show)
104103
)
105104
case Test(path, value) =>
106105
Obj(
107106
"op" -> Str("test"),
108107
"path" -> Str(path.show),
109-
"value" -> value,
108+
"value" -> value
110109
)
111110
}
112111

@@ -116,19 +115,21 @@ package object ujson {
116115
private def decodeOperation(value: Value): Operation[Value] = {
117116
def readPointer(value: Value, path: String = "path"): Pointer = {
118117
val serializedPointer =
119-
value.objOpt.flatMap(_.get(path))
118+
value.objOpt
119+
.flatMap(_.get(path))
120120
.getOrElse(throw FieldMissing(path))
121121

122122
read[Pointer](serializedPointer)
123123
}
124124

125125
val op =
126-
value
127-
.objOpt.flatMap(_.get("op").flatMap(_.strOpt))
126+
value.objOpt
127+
.flatMap(_.get("op").flatMap(_.strOpt))
128128
.getOrElse(throw FieldMissing("op"))
129129

130130
def getField(key: String) = {
131-
value.objOpt.flatMap(_.get(key))
131+
value.objOpt
132+
.flatMap(_.get(key))
132133
.getOrElse(throw FieldMissing(key))
133134
}
134135

ujson/shared/src/test/scala/diffson/ujson/UjsonJsonDiff.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Raphael Bosshard
2+
* Copyright 2022 Lucas Satabin
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

ujson/shared/src/test/scala/diffson/ujson/UjsonJsonJsonMergeDiff.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Raphael Bosshard
2+
* Copyright 2022 Lucas Satabin
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,9 +16,8 @@
1616

1717
package diffson
1818
package ujson
19-
import _root_.ujson._
2019

20+
import _root_.ujson._
2121
import jsonmergepatch._
2222

23-
class UjsonJsonJsonMergeDiff
24-
extends TestJsonMergeDiff[Value] with UjsonTestProtocol
23+
class UjsonJsonJsonMergeDiff extends TestJsonMergeDiff[Value] with UjsonTestProtocol

ujson/shared/src/test/scala/diffson/ujson/UjsonSimpleDiff.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Raphael Bosshard
2+
* Copyright 2022 Lucas Satabin
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

ujson/shared/src/test/scala/diffson/ujson/UjsonTestArrayDiff.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Raphael Bosshard
2+
* Copyright 2022 Lucas Satabin
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@ package diffson
1818
package ujson
1919

2020
import jsonpatch._
21-
import _root_.ujson as lihaoyUjson
21+
import _root_.ujson.Value
2222

23-
class UjsonTestArrayDiff
24-
extends TestArrayDiff[lihaoyUjson.Value] with UjsonTestProtocol
23+
class UjsonTestArrayDiff extends TestArrayDiff[Value] with UjsonTestProtocol

ujson/shared/src/test/scala/diffson/ujson/UjsonTestJsonMergePatch.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Raphael Bosshard
2+
* Copyright 2022 Lucas Satabin
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,5 +20,4 @@ package ujson
2020
import jsonmergepatch._
2121
import _root_.ujson._
2222

23-
class UjsonTestJsonMergePatch
24-
extends TestJsonMergePatch[Value] with UjsonTestProtocol
23+
class UjsonTestJsonMergePatch extends TestJsonMergePatch[Value] with UjsonTestProtocol

ujson/shared/src/test/scala/diffson/ujson/UjsonTestJsonPatch.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Raphael Bosshard
2+
* Copyright 2022 Lucas Satabin
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)