Repository: scala-steward-org/scala-steward (scala)

Issue:
Scala steward updated an unrelated plugin as well as the intended dependency
As the title says scala-steward tried to update a plugin as well as the intended dependency, they both happened to be on the same version (`2.4.0`).

The intended dependencies were `jsoniter-scala-core` and `jsoniter-scala-macros` from `2.4.0` to `2.4.1` (controlled by a single value), but it also updated the `sbt-scalafmt` plugin to `2.4.1` in the process.

You can see the PR here: https://github.com/permutive/fs2-google-pubsub/pull/123

Pull request description:

Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala b/modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala
index deeb34cf72..e67fe94a2c 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala
@@ -120,6 +120,9 @@ object UpdateHeuristic {
   private def removeCommonSuffix(str: String): String =
     util.string.removeSuffix(str, Update.commonSuffixes)
 
+  private def isCommonWord(s: String): Boolean =
+    s === "scala"
+
   val moduleId = UpdateHeuristic(
     name = "moduleId",
     replaceVersion = update =>
@@ -164,14 +167,14 @@ object UpdateHeuristic {
   val relaxed = UpdateHeuristic(
     name = "relaxed",
     replaceVersion = defaultReplaceVersion { update =>
-      util.string.extractWords(update.mainArtifactId)
+      util.string.extractWords(update.mainArtifactId).filterNot(isCommonWord)
     }
   )
 
   val sliding = UpdateHeuristic(
     name = "sliding",
     replaceVersion = defaultReplaceVersion(
-      _.mainArtifactId.toSeq.sliding(5).map(_.unwrap).filterNot(_ === "scala").toList
+      _.mainArtifactId.toSeq.sliding(5).map(_.unwrap).filterNot(isCommonWord).toList
     )
   )
 


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala b/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala
index 054a5d0153..a52243e478 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala
@@ -469,6 +469,24 @@ class UpdateHeuristicTest extends AnyFunSuite with Matchers {
     Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
       .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.original.name)
   }
+
+  test("issue 1489: ignore word: scala") {
+    val original =
+      """ val jsoniter = "2.4.0"
+        | addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0")
+        |""".stripMargin
+    val expected =
+      """ val jsoniter = "2.4.1"
+        | addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0")
+        |""".stripMargin
+    Update
+      .Group(
+        "com.github.plokhotnyuk.jsoniter-scala" %
+          Nel.of("jsoniter-scala-core", "jsoniter-scala-macros") % "2.4.0",
+        Nel.of("2.4.1")
+      )
+      .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.relaxed.name)
+  }
 }
 
 object UpdateHeuristicTest {