Skip to content

Commit def926b

Browse files
committed
Scalafix artifactId patterns must match whole artifactIds
Closes #2682.
1 parent 7a71483 commit def926b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/core/src/main/scala/org/scalasteward/core/edit/scalafix/ScalafixMigrationsFinder.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.scalasteward.core.edit.scalafix
1818

1919
import cats.syntax.all._
20+
import java.util.regex.Pattern
2021
import org.scalasteward.core.data.Update
2122
import org.scalasteward.core.edit.scalafix.ScalafixMigration.ExecutionOrder
2223

@@ -26,7 +27,8 @@ final class ScalafixMigrationsFinder(migrations: List[ScalafixMigration]) {
2627
.filter { migration =>
2728
update.groupId === migration.groupId &&
2829
migration.artifactIds.exists { re =>
29-
update.artifactIds.exists(artifactId => re.r.findFirstIn(artifactId.name).isDefined)
30+
val pattern = Pattern.compile(re)
31+
update.artifactIds.exists(artifactId => pattern.matcher(artifactId.name).matches())
3032
} &&
3133
update.currentVersion < migration.newVersion &&
3234
update.nextVersion >= migration.newVersion

0 commit comments

Comments
 (0)