Skip to content

Feat/scala3 hermant #872

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

Merged
merged 14 commits into from
Apr 9, 2022
Merged

Feat/scala3 hermant #872

merged 14 commits into from
Apr 9, 2022

Conversation

tomasherman
Copy link
Contributor

@tomasherman tomasherman commented Apr 6, 2022

attempt at scala3 support based on feat/scala3.

What is it about:

Whats missing:

  • rewrite few tests for scala3 that are now just for scala2
  • docs about pureconfig and scala3

What had to change:

  • in check task we now only check mdoc task for scala3 (we used to do it for all scala versions) - i don't know how to check it for all considering source code is now diverging for scala2 and scala3
  • few scalafix options had to be removed as they are scala2 only. I believe it's ok because scala3 is now the 'main' dialect and therefore we apply scalafix just for it, other scala versions are just xcompiled
  • scala3 pureconfig modules no longer support camel case - that is a limitation of pureconfig, we just reflect the change (see https://pureconfig.github.io/docs/scala-3-derivation.html)

@tomasherman
Copy link
Contributor Author

wohoo finally green

Copy link
Contributor

@sideeffffect sideeffffect left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for putting in the effort. But aren't we too hard on ourselves with Scala 3 as the default?

@@ -25,13 +31,13 @@ object BuildSettings {
description := "Functional programming toolkit for building server applications in Scala.",
licenses := Seq("MIT" -> url("https://raw.githubusercontent.com/avast/scala-server-toolkit/master/LICENSE")),
developers := List(Developer("jakubjanecek", "Jakub Janecek", "[email protected]", url("https://www.avast.com"))),
scalaVersion := "2.13.8",
crossScalaVersions := List(scalaVersion.value, "2.12.15"),
scalaVersion := scala3,
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 about having Scala 3 as the default is a good idea.
Wouldn't having 2.13 as the default save us a lot of headache with Scalafix (among other things)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

idk, in my view scala3 is the future so i would vote for shaping the code towards that ... i would also like to move further towards scala3 code in future PRs using compiler toggles etc

Copy link
Collaborator

Choose a reason for hiding this comment

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

My first choice would probably also be 2.13 for now but if everything works and we can compile to both versions the default is probably not that important.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it only makes a big difference for mdoc imho ... if its all the same to you, i would try to coarse the code into scala3 compatible code as much as possible so i think scala3 default is the best way to go

@tomasherman tomasherman marked this pull request as draft April 7, 2022 09:02
@tomasherman
Copy link
Contributor Author

(marked as draft so that it's not merged until everything is in place)

@tomasherman
Copy link
Contributor Author

ok i think this is ready for review if anyone else is interested

@tomasherman tomasherman marked this pull request as ready for review April 7, 2022 16:56
Copy link
Collaborator

@jakubjanecek jakubjanecek left a comment

Choose a reason for hiding this comment

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

Thank you!

@@ -25,13 +31,13 @@ object BuildSettings {
description := "Functional programming toolkit for building server applications in Scala.",
licenses := Seq("MIT" -> url("https://raw.githubusercontent.com/avast/scala-server-toolkit/master/LICENSE")),
developers := List(Developer("jakubjanecek", "Jakub Janecek", "[email protected]", url("https://www.avast.com"))),
scalaVersion := "2.13.8",
crossScalaVersions := List(scalaVersion.value, "2.12.15"),
scalaVersion := scala3,
Copy link
Collaborator

Choose a reason for hiding this comment

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

My first choice would probably also be 2.13 for now but if everything works and we can compile to both versions the default is probably not that important.

@tomasherman
Copy link
Contributor Author

Solved all the comments, im going to merge this once all checks pass. Next steps for me is to massage the code into more scala 3 style of code. I will leave it up to @jakubjanecek to release this once he feels like it

@tomasherman tomasherman enabled auto-merge (squash) April 9, 2022 16:07
@tomasherman
Copy link
Contributor Author

thanks for taking the time to review

@tomasherman tomasherman merged commit 2eae630 into master Apr 9, 2022
@tomasherman tomasherman deleted the feat/scala3-hermant branch April 9, 2022 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants