Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

scalafmt-core 3.5.8 (was 3.5.2) #775

Merged
merged 3 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.5.8
35642f55f59f4141d6c1c7d3368800ab2f3ff282
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.5.2
version = 3.5.8
runner.dialect = Scala213Source3

align.preset = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JsonDeserialize_01_List {

@Setup(Level.Iteration)
def setup(): Unit = {
val employees: Seq[Employee] = (1.to(100)).map { id =>
val employees: Seq[Employee] = 1.to(100).map { id =>
Employee(
id,
s"Foo$id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JsonMacros_02_SerializeList {

@Setup(Level.Iteration)
def setup(): Unit = {
employees = (1.to(100)).map { id =>
employees = 1.to(100).map { id =>
Employee(
id,
s"Foo$id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object FunctionalCanBuild {
implicit def functionalCanBuildApplicative[M[_]](implicit app: Applicative[M]): FunctionalCanBuild[M] =
new FunctionalCanBuild[M] {
def apply[A, B](a: M[A], b: M[B]): M[A ~ B] =
app.apply(app.map[A, B => A ~ B](a, a => ((b: B) => new ~(a, b))), b)
app.apply(app.map[A, B => A ~ B](a, a => (b: B) => new ~(a, b)), b)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,20 @@ class JsMacroImpl(val c: blackbox.Context) {
case tpe :: ts =>
resolvedType(tpe) match {
case t if filter(t) =>
refactor(ts, base, (replacement :: out), tail, filter, replacement, true)
refactor(ts, base, replacement :: out, tail, filter, replacement, true)

case TypeRef(_, sym, as) if as.nonEmpty =>
refactor(as, sym.asType, List.empty, (ts, base, out) :: tail, filter, replacement, altered)

case t => refactor(ts, base, (t :: out), tail, filter, replacement, altered)
case t => refactor(ts, base, t :: out, tail, filter, replacement, altered)
}

case _ => {
val tpe = appliedType(base.toTypeConstructor, out.reverse)

tail match {
case (x, y, more) :: ts =>
refactor(x, y, (tpe :: more), ts, filter, replacement, altered)
refactor(x, y, tpe :: more, ts, filter, replacement, altered)

case _ => tpe -> altered
}
Expand Down Expand Up @@ -442,8 +442,8 @@ class JsMacroImpl(val c: blackbox.Context) {
val applyParams = apply.paramLists.headOption.toList.flatMap(identity).map(_.typeSignature)
val unapplyParams = unapplyReturnTypes.toList.flatMap(identity)

(applyParams.size == unapplyParams.size &&
conforms((applyParams, unapplyParams).zipped.toSeq))
applyParams.size == unapplyParams.size &&
conforms((applyParams, unapplyParams).zipped.toSeq)
} =>
apply
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private[json] trait ImplicitResolver[A] {
refactor(
ts,
base,
(replacement :: out),
replacement :: out,
tail,
filter,
replacement,
Expand All @@ -67,7 +67,7 @@ private[json] trait ImplicitResolver[A] {
refactor(
ts,
base,
(t :: out),
t :: out,
tail,
filter,
replacement,
Expand All @@ -83,7 +83,7 @@ private[json] trait ImplicitResolver[A] {
refactor(
x,
y,
(tpe :: more),
tpe :: more,
ts,
filter,
replacement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private[json] trait QuotesHelper {
TypeBounds(t2 @ TermRef(_, _), _)
) if {
val emptyTupTpe = TypeRepr.of[EmptyTuple]
(Ref.term(t1).tpe <:< emptyTupTpe && Ref.term(t2).tpe <:< emptyTupTpe)
Ref.term(t1).tpe <:< emptyTupTpe && Ref.term(t2).tpe <:< emptyTupTpe
} =>
None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class JsObjectSpec extends AnyWordSpec with Matchers {
val originalObj = Json.obj(
"arrayWithNulls" -> Json.arr(
null,
(null: String),
null: String,
JsNull
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,8 @@ class JsonExtensionSpec extends AnyWordSpec with Matchers {

implicit def genericFormat[A: Format]: Format[GenericCaseClass[A]] =
(
(
(__ \ "obj").format[A]
).inmap
)(GenericCaseClass[A] _, x => (x.obj))
(__ \ "obj").format[A]
).inmap(GenericCaseClass[A] _, x => x.obj)

implicit val wrappedGenericIntFormat: OFormat[WrappedGenericInt] = Json.format[WrappedGenericInt]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ class JsonValidSharedSpec extends AnyWordSpec with Matchers {
.validate(jsonTransformer)
.mustEqual(
// JsError( (__ \ 'key3), "error.expected.jsarray" ) ++
JsError((__ \ Symbol("key2") \ Symbol("key22")), "error.path.missing")
JsError(__ \ Symbol("key2") \ Symbol("key22"), "error.path.missing")
)

js.validate(jsonTransformer).mustEqual(JsSuccess(res))
Expand Down Expand Up @@ -743,19 +743,19 @@ class JsonValidSharedSpec extends AnyWordSpec with Matchers {
.obj("id" -> 123L, "email" -> "john.doe@blibli.com", "age" -> 60)
.validate[User]
.mustEqual(
JsError((__ \ Symbol("age")), JsonValidationError("error.max", 55)) ++ JsError(
(__ \ Symbol("age")),
JsError(__ \ Symbol("age"), JsonValidationError("error.max", 55)) ++ JsError(
__ \ Symbol("age"),
JsonValidationError("error.min", 65)
)
)
Json
.obj("id" -> 123L, "email" -> "john.doe", "age" -> 60)
.validate[User]
.mustEqual(
JsError((__ \ Symbol("email")), JsonValidationError("error.email")) ++ JsError(
(__ \ Symbol("age")),
JsError(__ \ Symbol("email"), JsonValidationError("error.email")) ++ JsError(
__ \ Symbol("age"),
JsonValidationError("error.max", 55)
) ++ JsError((__ \ Symbol("age")), JsonValidationError("error.min", 65))
) ++ JsError(__ \ Symbol("age"), JsonValidationError("error.min", 65))
)
}

Expand Down Expand Up @@ -876,7 +876,7 @@ class JsonValidSharedSpec extends AnyWordSpec with Matchers {

"single field case class" in {
case class Test(field: String)
val myFormat = (__ \ Symbol("field")).format[String].inmap(Test.apply, (t: Test) => (t.field))
val myFormat = (__ \ Symbol("field")).format[String].inmap(Test.apply, (t: Test) => t.field)

myFormat.reads(Json.obj("field" -> "blabla")).mustEqual(JsSuccess(Test("blabla"), __ \ Symbol("field")))
myFormat.reads(Json.obj()).mustEqual(JsError(__ \ Symbol("field"), "error.path.missing"))
Expand Down