Skip to content

Commit 767fcfe

Browse files
committed
Fix Scala 3 check
the artifact contains a cross version, so only comparing the artifact name leads to the correct result adapt lowest Scala 3 NEXT version
1 parent 5642ead commit 767fcfe

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

Diff for: modules/core/src/main/scala/org/scalasteward/core/data/package.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ package object data {
3737
val scalaLangModules: List[(GroupId, ArtifactId)] =
3838
scala2LangModules ++ scala3LangModules
3939

40-
val scalaNextMinVersion: Version = Version("3.4.0")
40+
val scalaNextMinVersion: Version = Version("3.4.0-NIGHTLY")
4141
}

Diff for: modules/core/src/main/scala/org/scalasteward/core/update/FilterAlg.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,14 @@ object FilterAlg {
7979
val filteredVersions = update.newerVersions.filterNot(_ >= scalaNextMinVersion)
8080
if (filteredVersions.nonEmpty)
8181
Right(update.copy(newerVersions = Nel.fromListUnsafe(filteredVersions)))
82-
else Left(IgnoreScalaNext(update))
82+
else
83+
Left(IgnoreScalaNext(update))
8384
}
8485
}
8586

8687
def isScala3Lang(update: Update.ForArtifactId): Boolean =
8788
scala3LangModules.exists { case (g, a) =>
88-
update.groupId == g && update.artifactIds.exists(_ == a)
89+
update.groupId == g && update.artifactIds.exists(_.name == a.name)
8990
}
9091

9192
private def globalFilter(update: Update.ForArtifactId, repoConfig: RepoConfig): FilterResult =

Diff for: modules/core/src/test/scala/org/scalasteward/core/update/FilterAlgTest.scala

+12-3
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,26 @@ class FilterAlgTest extends FunSuite {
254254

255255
test("scalaLTSFilter: LTS, filter versions") {
256256
val update =
257-
("org.scala-lang".g % "scala3-compiler".a % "3.3.2" %> Nel.of("3.3.3", "3.4.0")).single
257+
("org.scala-lang".g % ("scala3-compiler", "scala3-compiler_3").a % "3.3.2" %> Nel.of(
258+
"3.3.3",
259+
"3.4.0"
260+
)).single
258261
assertEquals(scalaLTSFilter(update), Right(update.copy(newerVersions = Nel.of("3.3.3".v))))
259262
}
260263

261264
test("scalaLTSFilter: Next") {
262-
val update = ("org.scala-lang".g % "scala3-compiler".a % "3.4.0" %> Nel.of("3.4.1")).single
265+
val update =
266+
("org.scala-lang".g % ("scala3-compiler", "scala3-compiler_3").a % "3.4.0" %> Nel.of(
267+
"3.4.1"
268+
)).single
263269
assertEquals(scalaLTSFilter(update), Right(update))
264270
}
265271

266272
test("isScala3Lang: true") {
267-
val update = ("org.scala-lang".g % "scala3-compiler".a % "3.3.3" %> Nel.of("3.4.0")).single
273+
val update =
274+
("org.scala-lang".g % ("scala3-compiler", "scala3-compiler_3").a % "3.3.3" %> Nel.of(
275+
"3.4.0"
276+
)).single
268277
assert(isScala3Lang(update))
269278
}
270279

0 commit comments

Comments
 (0)