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

Fix Scala 3 check #3354

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ package object data {
val scalaLangModules: List[(GroupId, ArtifactId)] =
scala2LangModules ++ scala3LangModules

val scalaNextMinVersion: Version = Version("3.4.0")
val scalaNextMinVersion: Version = Version("3.4.0-NIGHTLY")
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ object FilterAlg {
val filteredVersions = update.newerVersions.filterNot(_ >= scalaNextMinVersion)
if (filteredVersions.nonEmpty)
Right(update.copy(newerVersions = Nel.fromListUnsafe(filteredVersions)))
else Left(IgnoreScalaNext(update))
else
Left(IgnoreScalaNext(update))
}
}

def isScala3Lang(update: Update.ForArtifactId): Boolean =
scala3LangModules.exists { case (g, a) =>
update.groupId == g && update.artifactIds.exists(_ == a)
update.groupId == g && update.artifactIds.exists(_.name == a.name)
}

private def globalFilter(update: Update.ForArtifactId, repoConfig: RepoConfig): FilterResult =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,26 @@ class FilterAlgTest extends FunSuite {

test("scalaLTSFilter: LTS, filter versions") {
val update =
("org.scala-lang".g % "scala3-compiler".a % "3.3.2" %> Nel.of("3.3.3", "3.4.0")).single
("org.scala-lang".g % ("scala3-compiler", "scala3-compiler_3").a % "3.3.2" %> Nel.of(
"3.3.3",
"3.4.0"
)).single
assertEquals(scalaLTSFilter(update), Right(update.copy(newerVersions = Nel.of("3.3.3".v))))
}

test("scalaLTSFilter: Next") {
val update = ("org.scala-lang".g % "scala3-compiler".a % "3.4.0" %> Nel.of("3.4.1")).single
val update =
("org.scala-lang".g % ("scala3-compiler", "scala3-compiler_3").a % "3.4.0" %> Nel.of(
"3.4.1"
)).single
assertEquals(scalaLTSFilter(update), Right(update))
}

test("isScala3Lang: true") {
val update = ("org.scala-lang".g % "scala3-compiler".a % "3.3.3" %> Nel.of("3.4.0")).single
val update =
("org.scala-lang".g % ("scala3-compiler", "scala3-compiler_3").a % "3.3.3" %> Nel.of(
"3.4.0"
)).single
assert(isScala3Lang(update))
}

Expand Down