-
Notifications
You must be signed in to change notification settings - Fork 542
add scala 3 macro support for literal #1874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, everything looks great, just a few nit picks.
Nit: Can you remove scala-3/.../LiteralInstances.scala
since its not needed and its empty anyways?
build.sbt
Outdated
Compile / unmanagedSourceDirectories ++= { | ||
def extraDirs(suffix: String) = | ||
CrossType.Pure.sharedSrcDir(baseDirectory.value, "main").toList.map(f => file(f.getPath + suffix)) | ||
|
||
CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, y)) => extraDirs("-2") ++ (if (y >= 13) extraDirs("-2.13+") else Nil) | ||
case Some((3, _)) => extraDirs("-3") ++ extraDirs("-2.13+") | ||
case _ => Nil | ||
} | ||
}, | ||
Test / unmanagedSourceDirectories ++= { | ||
def extraDirs(suffix: String) = | ||
CrossType.Pure.sharedSrcDir(baseDirectory.value, "test").toList.map(f => file(f.getPath + suffix)) | ||
|
||
CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, y)) => extraDirs("-2") ++ (if (y >= 13) extraDirs("-2.13+") else Nil) | ||
case Some((3, _)) => extraDirs("-3") ++ extraDirs("-2.13+") | ||
case _ => Nil | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't appear to be necessary to me? I removed it and re-ran the tests for Literal and they appeared just fine. I'm pretty sure these are already being set correctly.
@@ -0,0 +1,98 @@ | |||
package io.circe.literal | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we need to run scalafmt on these changes. I see a few places missing spaces or having the space in the wrong place. Can you correct that please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
I updated scalafmt to latest for this.
Thank you for reviewing. I will fix what you pointed out soon! |
88dffa5
to
3f79232
Compare
3f79232
to
748e73e
Compare
@i10416 Looks like the build.sbt file isn't formatted with scalaFmt correctly. |
Oh, I forgot running scalafmtSbt |
Codecov Report
@@ Coverage Diff @@
## main #1874 +/- ##
==========================================
+ Coverage 86.25% 86.32% +0.07%
==========================================
Files 73 73
Lines 2531 2531
Branches 143 130 -13
==========================================
+ Hits 2183 2185 +2
+ Misses 348 346 -2
Continue to review full report at Codecov.
|
"org.scalacheck" %%% "scalacheck" % scalaCheckVersion % Test, | ||
"org.scalameta" %%% "munit" % munitVersion % Test, | ||
"org.scalameta" %%% "munit-scalacheck" % munitVersion % Test | ||
) | ||
) ++ (if (isScala3.value) Seq("org.typelevel" %% "jawn-parser" % jawnVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work as-is on Scala.js.
) ++ (if (isScala3.value) Seq("org.typelevel" %% "jawn-parser" % jawnVersion) | |
) ++ (if (isScala3.value) Seq("org.typelevel" %%% "jawn-parser" % jawnVersion) |
Hello, I added scala 3 macro support for literal module.
+literalJVM/test
passed for scala 2.12, 2.13 and 3.1