Skip to content

Commit 014ed4a

Browse files
joroKr21TimWSpencebplommerandrzejresselscala-steward
authored
Scala 3 support (#514)
* Setup build for Scala 3 * Hello Scala 3 + Shapeless 3 * For now use test instead of validate * Use the correct source directory * Fix version specific source directories (#331) * Derive Functor, Foldable, Traverse (#330) * Derive Eq, PartialOrder, Order and Hash (#336) Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Derive Commutative{Semigroup, Monoid} (#341) * Derive Show with field labels (#340) * Derive Show with field labels * Make show safe for empty products * Use SAM functions to avoid anonymous class generation * Derive MonoidK hierarchy (#342) * Scala 3.0, Shapeless 3.0 and other dependencies (#343) * Cleanup Const - it's provided by shapeless (#345) Also use the constant type directly for brevity * Derive Contravariant and Invariant (#346) * Reducible derivation (#347) * Deep and Coproduct Empty derivation (#349) * Use summonFrom to prioritize DerivedEmpty instances (#355) * Further simplify Empty derivation (#356) * Generic Derived opaque type for given priority (#359) * semiauto and auto imports (#353) * Update sbt and shapeless, use project to derive Show for products (#363) * Port functor tests (#362) Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Port FoldableSuite to Scala 3 (#374) * Port ReducibleSuite to Scala 3 (#379) * Port TraverseSuite to Scala 3 (#377) * [WIP] Port TraverseSuite to Scala 3 * Update shapeless and fix TraverseSuite * Port EmptySuite and also solve Empty for Coproducts (#387) * Port tests for Semigroup and Monoid (#389) * Rename files according to classes * Derive Semigroup and Monoid * Port tests for Semigroup and Monoid * Port Eq and Hash plus tests (#393) * Port NonEmptyTraverse derivation to Scala 3 (#394) * Make derived methods final override (#395) * Bump Scala and Cats and comment out tests that don't work (#427) * Bump Scala and comment out tests that don't work * Update cats * Bump Scala 2 versions and Kind projector * Port Show with tests (#433) * Implement Eq derivation for Dotty * Restore serializable * Port Apply to Dotty (#441) * Port Apply to Dotty * Apply -> Or Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Make testApply inline Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Port Order to Dotty (#440) * Port Order to Dotty * MR comments fixes * Port Applicative to Dotty (#439) * Port Applicative to dotty * Code cleanup * Comment out Tuple * Use Apply for deriving Applicative * Composite Applicative can also be derived Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Merge master to dotty branch (#446) * Update shapeless to 2.3.6 (#328) * Update sbt to 1.5.2 (#329) * Update kind-projector to 0.12.0 * Update sbt-mima-plugin to 0.9.1 (#333) * Update discipline-munit to 1.0.9 (#335) * Update alleycats-core, cats-core, ... to 2.6.1 (#334) Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Update kind-projector to 0.13.0 (#337) * Update shapeless to 2.3.7 (#338) * Update scala-library, scala-reflect to 2.13.6 (#339) * Add VSCode .ignore files (#344) * Update sbt-github-actions to 0.11.0 (#348) * Update sbt-mima-plugin to 0.9.2 (#350) * Update scala-library, scala-reflect to 2.12.14 (#351) * Update sbt to 1.5.3 (#352) * Update sbt-github-actions to 0.12.0 * Regenerate workflow with sbt-github-actions * Update sbt-scalajs, scalajs-library, ... to 1.6.0 * Update sbt to 1.5.4 (#365) * Update sbt-scala-native-crossproject, ... to 1.1.0 (#366) * Update sbt-scalafmt to 2.4.3 (#367) * Update sbt to 1.5.5 (#368) * Update sbt-scalajs, scalajs-compiler, ... to 1.7.0 (#369) * Update sbt-github-actions to 0.13.0 (#370) * Update scalafmt-core to 3.0.0 (#371) * Update scalafmt-core to 3.0.0 * Reformat with scalafmt 3.0.0 * Update sbt-mima-plugin to 1.0.0 (#372) * Update kind-projector to 0.13.1 (#373) * Update scalafmt-core to 3.0.1 (#378) * Update kind-projector to 0.13.2 (#381) * Update scalafmt-core to 3.0.2 (#380) * Update scalafmt-core to 3.0.3 (#382) * Update scalafmt-core to 3.0.4 (#384) * Update scala-library, scala-reflect to 2.12.15 (#383) * Update sbt-ci-release to 1.5.9 (#385) * Update scalafmt-core to 3.0.5 (#386) * Remove unnecessary instance (#388) It was merged in cats-core. * Update scalafmt-core to 3.0.6 (#390) * Update sbt-mima-plugin to 1.0.1 (#391) * Update sbt-scalajs, scalajs-compiler, ... to 1.7.1 (#392) * Update sbt-ci-release to 1.5.10 (#396) * Update scalafmt-core to 3.0.7 (#397) * Update auxlib, javalib, nativelib, nscplugin, ... to 0.4.1 (#398) * Update scalafmt-core to 3.0.8 (#399) * Update scala-library, scala-reflect to 2.13.7 (#400) * Update scalafmt-core to 3.1.1 (#403) * Update scalafmt-core to 3.1.1 * Specify runner dialect explicitly Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Update sbt-scalafmt to 2.4.4 (#404) * Update scalafmt-core to 3.1.2 (#405) * Update alleycats-core, cats-core, ... to 2.7.0 (#406) * Update scalafmt-core to 3.2.0 (#407) * Update sbt-github-actions to 0.14.2 (#409) * Update sbt-github-actions to 0.14.2 * Set Java version to Temurin 8 Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Update scalafmt-core to 3.2.1 (#410) * Update sbt-scalafmt to 2.4.5 (#411) * Update auxlib, javalib, nativelib, nscplugin, ... to 0.4.2 (#412) * Update sbt to 1.5.6 (#413) * Update sbt-scalajs, scalajs-compiler, ... to 1.8.0 (#414) * Update sbt to 1.5.7 (#415) * Update sbt to 1.5.8 (#416) * Update scalafmt-core to 3.2.2 (#417) * Update scalafmt-core to 3.3.0 (#419) * Update sbt-scalafmt to 2.4.6 (#418) * Update sbt to 1.6.0 (#420) * Update sbt to 1.6.1 (#421) * Update scalafmt-core to 3.3.1 (#424) * Update scala-library, scala-reflect to 2.13.8 (#426) * Update scalafmt-core to 3.3.2 (#428) * Update auxlib, javalib, nativelib, nscplugin, ... to 0.4.3 (#430) * Update scalafmt-core to 3.3.3 (#431) * Update scalafmt-core to 3.4.0 (#432) * Update sbt to 1.6.2 (#434) * Migrate to sbt-typelevel-ci-release (#429) * Migrate to sbt-typelevel-ci-release * Rescope publish settings * Set tlVersionIntroduced * Poke ci * Update to latest sbt-typelevel * Update scalafmt-core to 3.4.2 (#436) * Use predefined Apache 2 license (#437) * Enable snapshots on master (#438) * Delete .sbtrc * Publish snapshots from master * Update sbt-typelevel-ci-release to 0.4.4 (#442) * Update sbt-typelevel-ci-release to 0.4.4 * Regenerate workflow with sbt-github-actions * Update sbt-typelevel-ci-release to 0.4.5 (#443) * Update scalafmt-core to 3.4.3 (#444) * Update shapeless to 2.3.8 (#445) * Reformat * Release from Dotty branch Co-authored-by: Arman Bilge <armanbilge@gmail.com> * Update Scala.js to 1.9.0 * Regenerate workflow * Specify Munit version explicitly * Don't override scalacOptions * Check sbt formatting in root project Co-authored-by: Arman Bilge <armanbilge@gmail.com> * githubWorkflowGenerate Co-authored-by: Scala Steward <43047562+scala-steward@users.noreply.github.com> Co-authored-by: Scala Steward <me@scala-steward.org> Co-authored-by: Lars Hupel <lars.hupel@mytum.de> Co-authored-by: Arman Bilge <armanbilge@gmail.com> * Update to Scala 3.1.2-RC3 and fix outstanding issues (#455) * Scala 3.1.2 (#464) * Scala 3.1.2 * Update sbt to 1.7.0-M1 and set scalaOutputVersion * Port EmptyK to dotty (#448) * Port EmptyK to dotty * Fix formatting * Support EmptyK for sum types * Refactor EmptyKSuite Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Fix ApplicativeSuite (#465) * Shapeless 3.1.0 (#468) Also revert scalaOutputVersion - it's future is unclear * Derive Pure for Scala 3 (#470) * Add missing implicit not found messages (#471) Unfortunately the experiece is subpar, because it doesn't work well with type aliases which don't support type argument interpolation. * Port Semigroupk/Monoidk to new scheme (#472) * Port SemigroupK and MonoidK to new derivation scheme * WIP port of SemigroupK suite to scala 3 * Nested derivations for SemigroupK * Priority for derived SemigroupK given instances * Port scala 2 MonoidK tests to scala 3 * Various improvements - ImplicitNotFound error for SemigroupK/MonoidK - Replace given priority via traits with NotGiven * Use inline in tests * SemigroupK/MonoidK test for derives syntax * Port contravariant to new scheme (#475) * Port SemigroupK and MonoidK to new derivation scheme * WIP port of SemigroupK suite to scala 3 * Nested derivations for SemigroupK * Priority for derived SemigroupK given instances * Port scala 2 MonoidK tests to scala 3 * Various improvements - ImplicitNotFound error for SemigroupK/MonoidK - Replace given priority via traits with NotGiven * Use inline in tests * SemigroupK/MonoidK test for derives syntax * Port Contravariant to new derivation scheme * WIP port scala 2 Contravariant tests to scala 3 * Link commented out tests to issues * derives syntax tests for Contravariant * derives syntax tests for Contravariant * Scala 3 import syntax * Port invariant to new scheme (#478) * Port invariant derivation to new scheme * Port scala 2 invariant tests to scala 3 * Consistent test naming * WIP extra Invariant instances * Tests for invariant derivation syntax * Port partial order to new scheme (#480) * Port invariant derivation to new scheme * Port scala 2 invariant tests to scala 3 * Consistent test naming * WIP extra Invariant instances * Tests for invariant derivation syntax * Rename partial order derivation * Port partial order derivation to new scheme * Rename to PartialOrderSuite * Port scala 2 partial order suite to scala 3 Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Require Or instances for givens (#486) * Scala 3 all the tests (#485) * Replace all usages of implicit with given for Scala 3 Also use braceless syntax in more places. * Scala 3 all the tests Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Remove obsolete Instances (#487) * Derive ShowPretty (#490) * WIP derive ShowPretty * Derive ShowPretty * Derive ShowPretty WIP * Fix show pretty derivations * Fix ShowPretty tests Define companion object as scala/scala3#15391 isn't released yet * Nicer syntax * Test scala 3 enums (#498) * Test with scala 3 enums * More enum tests * Fix typo * Add other branches to test enums * Simplify recursive Gen logic * Cross-build for Native (#501) * Cross-build for Native * Bump munit version * Bump cats * Update auto instance implicit error messages Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Upgrade to Scala 3.2 (#513) * Upgrade to Scala 3.2 Contains a load of fixes that we need, particularly for Mirror synthesis * Regenerate GH workflow * Update the rest of dependencies Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Docs (#509) * Scala 3 docs * Typo * Clarify type constructor field limitations * Extra clarification on the combination of auto and semiauto * Apply suggestions from code review Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com> * Fix and simplify ApplySuite Co-authored-by: Tim Spence <timothywspence@gmail.com> Co-authored-by: Ben Plommer <ben.plommer@gmail.com> Co-authored-by: ​Andrzej Ressel <green.hope9220@fastmail.com> Co-authored-by: Scala Steward <43047562+scala-steward@users.noreply.github.com> Co-authored-by: Scala Steward <me@scala-steward.org> Co-authored-by: Lars Hupel <lars.hupel@mytum.de> Co-authored-by: Arman Bilge <armanbilge@gmail.com>
1 parent 470ddb3 commit 014ed4a

File tree

141 files changed

+4247
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+4247
-22
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
matrix:
3030
os: [ubuntu-latest]
31-
scala: [2.12.16, 2.13.8]
31+
scala: [2.12.16, 2.13.8, 3.2.0]
3232
java: [temurin@8]
3333
project: [rootJS, rootJVM, rootNative]
3434
runs-on: ${{ matrix.os }}
@@ -114,7 +114,7 @@ jobs:
114114
strategy:
115115
matrix:
116116
os: [ubuntu-latest]
117-
scala: [2.13.8]
117+
scala: [3.2.0]
118118
java: [temurin@8]
119119
runs-on: ${{ matrix.os }}
120120
steps:
@@ -211,6 +211,36 @@ jobs:
211211
tar xf targets.tar
212212
rm targets.tar
213213
214+
- name: Download target directories (3.2.0, rootJS)
215+
uses: actions/download-artifact@v2
216+
with:
217+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootJS
218+
219+
- name: Inflate target directories (3.2.0, rootJS)
220+
run: |
221+
tar xf targets.tar
222+
rm targets.tar
223+
224+
- name: Download target directories (3.2.0, rootJVM)
225+
uses: actions/download-artifact@v2
226+
with:
227+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootJVM
228+
229+
- name: Inflate target directories (3.2.0, rootJVM)
230+
run: |
231+
tar xf targets.tar
232+
rm targets.tar
233+
234+
- name: Download target directories (3.2.0, rootNative)
235+
uses: actions/download-artifact@v2
236+
with:
237+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootNative
238+
239+
- name: Inflate target directories (3.2.0, rootNative)
240+
run: |
241+
tar xf targets.tar
242+
rm targets.tar
243+
214244
- name: Import signing key
215245
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
216246
run: echo $PGP_SECRET | base64 -di | gpg --import

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@ metals.sbt
3232
.*.swp
3333
.swo
3434
.*.swo
35+
36+
# VS Code
37+
.bloop
38+
.bsp
39+
.metals
40+
.vscode
41+
**/metals.sbt

.mergify.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ pull_request_rules:
1818
- status-success=Build and Test (ubuntu-latest, 2.13.8, temurin@8, rootJS)
1919
- status-success=Build and Test (ubuntu-latest, 2.13.8, temurin@8, rootJVM)
2020
- status-success=Build and Test (ubuntu-latest, 2.13.8, temurin@8, rootNative)
21+
- status-success=Build and Test (ubuntu-latest, 3.2.0, temurin@8, rootJS)
22+
- status-success=Build and Test (ubuntu-latest, 3.2.0, temurin@8, rootJVM)
23+
- status-success=Build and Test (ubuntu-latest, 3.2.0, temurin@8, rootNative)
2124
actions:
2225
merge: {}
2326
- name: Label core PRs

.scalafmt.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ rewrite.redundantBraces.stringInterpolation = true
1010
rewrite.redundantBraces.methodBodies = true
1111
rewrite.redundantBraces.generalExpressions = true
1212
rewriteTokens = { "⇒": "=>", "→": "->", "←": "<-" }
13-
fileOverride { "glob:**/*.sbt" { runner.dialect = scala212 } }
13+
fileOverride {
14+
"glob:**/*.sbt" { runner.dialect = scala212 },
15+
"glob:**/scala-3/**" { runner.dialect = scala3 }
16+
}

README.md

Lines changed: 106 additions & 1 deletion

build.sbt

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,54 @@
11
import sbt._
22

3-
ThisBuild / crossScalaVersions := Seq("2.12.16", "2.13.8")
4-
ThisBuild / scalaVersion := "2.13.8"
5-
ThisBuild / tlBaseVersion := "2.3"
3+
val scala212 = "2.12.16"
4+
val scala213 = "2.13.8"
5+
val scala3 = "3.2.0"
6+
7+
ThisBuild / crossScalaVersions := Seq(scala212, scala213, scala3)
8+
ThisBuild / scalaVersion := scala3
9+
ThisBuild / tlBaseVersion := "3.0"
610
ThisBuild / organization := "org.typelevel"
711

812
val catsVersion = "2.8.0"
9-
val disciplineMunitVersion = "1.0.9"
13+
val munitVersion = "1.0.0-M6"
14+
val disciplineMunitVersion = "2.0.0-M3"
1015
val kindProjectorVersion = "0.13.2"
11-
val shapelessVersion = "2.3.9"
16+
val shapeless2Version = "2.3.8"
17+
val shapeless3Version = "3.1.0"
1218

1319
lazy val commonSettings = Seq(
14-
scalacOptions := Seq(
20+
scalacOptions ++= Seq(
1521
"-feature",
1622
"-language:higherKinds",
1723
"-language:implicitConversions",
1824
"-unchecked",
1925
"-deprecation",
2026
"-Xfatal-warnings"
2127
),
22-
scalacOptions ++= (
23-
CrossVersion.partialVersion(scalaVersion.value) match {
24-
case Some((2, v)) if v <= 12 => Seq("-Ypartial-unification")
25-
case _ => Seq.empty
26-
}
27-
),
28+
scalacOptions ++= CrossVersion.partialVersion(scalaVersion.value).toList.flatMap {
29+
case (3, _) => List("-Xmax-inlines", "64")
30+
case (2, 12) => List("-Ypartial-unification")
31+
case _ => Nil
32+
},
2833
resolvers ++= Resolver.sonatypeOssRepos("releases"),
2934
resolvers ++= Resolver.sonatypeOssRepos("snapshots"),
3035
libraryDependencies ++= Seq(
3136
"org.typelevel" %%% "cats-core" % catsVersion,
3237
"org.typelevel" %%% "alleycats-core" % catsVersion,
33-
"com.chuusai" %%% "shapeless" % shapelessVersion,
3438
"org.typelevel" %%% "cats-testkit" % catsVersion % Test,
35-
"org.scalameta" %%% "munit" % "0.7.29" % Test,
3639
"org.typelevel" %%% "discipline-munit" % disciplineMunitVersion % Test,
37-
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Test,
38-
compilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full))
40+
"org.scalameta" %%% "munit" % munitVersion % Test
3941
),
42+
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
43+
case Some((3, _)) =>
44+
Seq("org.typelevel" %%% "shapeless3-deriving" % shapeless3Version)
45+
case _ =>
46+
Seq(
47+
"com.chuusai" %%% "shapeless" % shapeless2Version,
48+
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Test,
49+
compilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full))
50+
)
51+
}),
4052
Test / parallelExecution := false
4153
)
4254

@@ -74,14 +86,15 @@ ThisBuild / licenses := Seq(License.Apache2)
7486
ThisBuild / developers := List(
7587
Developer("milessabin", "Miles Sabin", "", url("http://milessabin.com/blog")),
7688
Developer("kailuowang", "Kai(luo) Wang", "kailuo.wang@gmail.com", url("http://kailuowang.com/")),
77-
Developer("joroKr21", "Georgi Krastev", "joro.kr.21@gmail.com", url("https://twitter.com/Joro_Kr"))
89+
Developer("joroKr21", "Georgi Krastev", "joro.kr.21@gmail.com", url("https://twitter.com/Joro_Kr")),
90+
Developer("TimWSpence", "Tim Spence", "timothywspence@gmail.com", url("https://twitter.com/timwspence"))
7891
)
7992

93+
ThisBuild / tlCiScalafmtCheck := true
8094
ThisBuild / tlCiReleaseBranches := Seq("master")
8195
ThisBuild / mergifyStewardConfig := Some(
8296
MergifyStewardConfig(
8397
author = "typelevel-steward[bot]",
8498
mergeMinors = true
8599
)
86100
)
87-
ThisBuild / tlCiScalafmtCheck := true

0 commit comments

Comments
 (0)