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
Give some love to the project #1175
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.
Looks good, thanks
case '{ Assertion.Regex.anyRegexOf(${Expr(first)}, ${Expr(second)}, ${Varargs(rest)}: _*) } => Some(Assertion.Regex.anyRegexOf(first, second, Varargs(rest).valueOrError*)) | ||
case '{ Assertion.Regex.notAnyCharOf(${Expr(first)}, ${Expr(second)}, ${Varargs(rest)}: _*) } => Some(Assertion.Regex.notAnyCharOf(first, second, Varargs(rest).valueOrError*)) | ||
case '{ Assertion.Regex.notAnyRegexOf(${Expr(first)}, ${Expr(second)}, ${Varargs(rest)}: _*) } => Some(Assertion.Regex.notAnyRegexOf(first, second, Varargs(rest).valueOrError*)) | ||
case '{ Assertion.Regex.anyCharOf(${Expr(first)}, ${Expr(second)}, ${Varargs(rest)}: _*) } => Some(Assertion.Regex.anyCharOf(first, second, Varargs(rest).valueOrAbort*)) |
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.
Was generating the following scalac warning:
[warn] -- Deprecation Warning: /Users/jules/conduktor/workspace/zio-prelude/core/shared/src/main/scala-3/zio/prelude/Liftables.scala:40:152
[warn] 40 | case '{ Assertion.Regex.anyCharOf(${Expr(first)}, ${Expr(second)}, ${Varargs(rest)}: _*) } => Some(Assertion.Regex.anyCharOf(first, second, Varargs(rest).valueOrError*))
[warn] | ^
[warn] |method valueOrError in trait Quotes is deprecated since 3.1.0: Use valueOrAbort
See https://github.com/lampepfl/dotty/blob/main/library/src/scala/quoted/Quotes.scala
@@ -130,7 +130,7 @@ trait Liftables { | |||
case _: Short => summon[Numeric[Short]].asInstanceOf[Numeric[Any]] | |||
case _: Byte => summon[Numeric[Byte]].asInstanceOf[Numeric[Any]] | |||
case _: Char => summon[Numeric[Char]].asInstanceOf[Numeric[Any]] | |||
case other => report.throwError(s"NO NUMERIC FOR $other") | |||
case other => report.errorAndAbort(s"NO NUMERIC FOR $other") |
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.
Was generating the following scalac warning:
[warn] -- Deprecation Warning: /Users/jules/conduktor/workspace/zio-prelude/core/shared/src/main/scala-3/zio/prelude/Liftables.scala:133:31
[warn] 133 | case other => report.throwError(s"NO NUMERIC FOR $other")
[warn] | ^^^^^^^^^^^^^^^^^
[warn] |method throwError in trait reportModule is deprecated since 3.1.0: Use errorAndAbort
See https://github.com/lampepfl/dotty/blob/main/library/src/scala/quoted/Quotes.scala
case Some((2, 12)) => | ||
List("2.11+", "2.12+", "2.11-2.12", "2.12-2.13") | ||
List("2.12", "2.12+", "2.12-2.13") |
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.
2.12
is still used for https://github.com/zio/zio-prelude/pull/1175/files#diff-be30bee277855f18960ddd438b1594a798cbaf405b6e0ab9d4d7eccf3d965638
This class was in 2.11-2.12
. I transferred it to this 2.12
directory.
It may not be the best decision.
I decided to do this so I'm sure not to change the behaviour.
You might want to have a second look as I made some changes and added some comments to explain some of my changes 🙂 |
ThisBuild / scalaVersion := Scala213, | ||
scalacOptions ++= stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value), | ||
libraryDependencies ++= { | ||
if (scalaVersion.value == Scala3) | ||
Seq( | ||
"com.github.ghik" % s"silencer-lib_$Scala213" % SilencerVersion % Provided |
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.
I removed Silencer because, from its doc:
NOTE: Scala 2.13.2 and 2.12.13 introduced scala/scala#8373. This means that unless you're still cross compiling for Scala 2.11, this plugin is obsolete, and you should use @nowarn.
@@ -863,7 +863,7 @@ object Equal extends EqualVersionSpecific { | |||
* Since there is only one `Unit` value all equality comparisons will always be true. | |||
*/ | |||
implicit val UnitHashOrd: Hash[Unit] with Ord[Unit] = | |||
HashOrd.make(_.hashCode, (_, _) => Ordering.Equals, (_, _) => true) | |||
HashOrd.make(_ => 0, (_, _) => Ordering.Equals, (_, _) => true) |
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.
We definitely wan to behave like hashCode
.
Still needs formatting |
}, | ||
semanticdbEnabled := scalaVersion.value != Scala3, // enable SemanticDB | ||
semanticdbOptions += "-P:semanticdb:synthetics:on", | ||
semanticdbVersion := scalafixSemanticdb.revision, // use Scalafix compatible version | ||
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value), | ||
ThisBuild / scalafixDependencies ++= List( | ||
"com.github.liancheng" %% "organize-imports" % "0.6.0", |
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.
organize-imports
has been incorporated in scalafix 0.11.0
You were too fast 🙂 Based on the discussion I had here: https://discord.com/channels/632150470000902164/632150470000902166/1139171420312719400, in the end, I just added a |
Remove Scala 2.11 support as ZIO doesn't support it anymore