Skip to content
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

Scala 3.0.0-M3 #158

Merged
merged 19 commits into from
Jan 4, 2021
Merged

Scala 3.0.0-M3 #158

merged 19 commits into from
Jan 4, 2021

Conversation

keynmol
Copy link
Collaborator

@keynmol keynmol commented Dec 17, 2020

Super early version, most compilation works (apart from scalacheck) scalacheck works

Dirty comments left here'n'there

Lots of compat layers, lots of withDottyCompat

Given it's a test framework, it might not be a horrible idea to publish versions with withDottyCompat.

Tested with locally published eed3si9n/expecty#35 0.15.0 is published

TODO:

  • Improve the Build Matrix in docs

Base automatically changed from project-matrix-and-CE3 to master December 18, 2020 15:10
@keynmol keynmol changed the title WIP: Scala 3.0.0-M2 galore WIP: Scala 3.0.0-M3 galore Dec 22, 2020

// Recursively consumes from a channel until a "None" gets produced,
// indicating the end of the stream.
def consume(
private def consume(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably make this package private, I know I use it internally.

@@ -31,7 +34,7 @@ object PropertyDogFoodTest extends IOSuite {
// 100 checks sleeping 1 second each should not take 100 seconds
test("Checks are parallelised") { dogfood =>
for {
(_, events) <- dogfood.runSuite(Meta.ParallelChecks)
events <- dogfood.runSuite(Meta.ParallelChecks).map(_._2)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC that's because better-monadic-for is not available on Scala 3.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes me SO GODDAMN ANGRY

@keynmol keynmol changed the title WIP: Scala 3.0.0-M3 galore Scala 3.0.0-M3 Jan 4, 2021
@keynmol keynmol marked this pull request as ready for review January 4, 2021 10:31
"scalafix" ::
"test:scalafix" :: state
"scalafix" ::
"test:scalafix" ::
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because scalafix can actually change the formatting :-/

),
libraryDependencies ++= {
if (virtualAxes.value.contains(VirtualAxis.jvm))
Seq(
"org.scala-js" %%% "scalajs-stubs" % "1.0.0" % "provided"
("org.scala-js" %%% "scalajs-stubs" % "1.0.0" % "provided").withDottyCompat(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this dep is like 2 annotations, may be we can copypaste it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm not sure how we could do it without polluting the user's classpath tbh. I think having the dotty compat on this one is low risk for the time being, since it's a compile-only thing.

build.sbt Outdated
@@ -217,7 +221,8 @@ lazy val specs2 = projectMatrix
name := "specs2",
testFrameworks := Seq(new TestFramework("weaver.framework.CatsEffect")),
libraryDependencies ++= Seq(
"org.specs2" %%% "specs2-matcher" % "4.10.5"
("org.specs2" %%% "specs2-matcher" % "4.10.5").withDottyCompat(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing a 3.0.0-M3 release yet, so this might have to become onlyScala2 for the time being.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. with making it scala 2 only?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. with making it scala 2 only?

yes

project/WeaverPlugin.scala Outdated Show resolved Hide resolved
@keynmol keynmol mentioned this pull request Jan 4, 2021
scalaVersions.map(addOne(_, platform, catsEffectAxis)).reduce(_ andThen _)
}

def onlyCatsEffect2(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's try and make this a bit more conceptually consistent, by changing it to :

def sparse(
  withCE3 : Boolean = true, 
  withJS: Boolean = true, 
  withScala3: Boolean = true
) 


object Expectable {
def apply[F[_], B](implicit ev: Expectable[F, B]): Expectable[F, B] = ev
implicit def syncExpectable[F[_]: Sync]: Expectable[F, Expectations] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be constrained to Applicative, with pure being used

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love me a bit of Sync here and there. Good point, not sure why I needed this.

@@ -6,6 +6,24 @@ import cats.data.{ NonEmptyList, Validated, ValidatedNel }
import cats.effect.Sync
import cats.syntax.all._

trait Expectable[F[_], A] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this should be in core, since we only use it for scalacheck. Maybe we should rename it to Prop

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we can move it into Checkers itself?

Copy link
Contributor

@Baccata Baccata Jan 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the companion object, sure ...

@keynmol keynmol merged commit 663b891 into master Jan 4, 2021
@keynmol keynmol deleted the scala-3 branch January 4, 2021 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants