Skip to content

Commit 7cb87d8

Browse files
committed
Improved content parser for .mill-version file
Fix sugested by Frank Thomas.
1 parent 32c1c61 commit 7cb87d8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ object UpdateHeuristic {
215215
defaultReplaceVersion(_ => List("version"))(update)
216216
case update: Update.Single if MillAlg.isMillMainUpdate(update) =>
217217
// this is intended to update the `.mill-version`
218-
content => if (content === update.currentVersion) Some(update.nextVersion) else None
218+
content => if (content.trim() === update.currentVersion) Some(update.nextVersion) else None
219219
case _ =>
220220
_ => None
221221
}

modules/core/src/test/scala/org/scalasteward/core/edit/EditAlgTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class EditAlgTest extends FunSuite {
258258
newerVersions = Nel.of("0.9.9")
259259
)
260260
val original = Map(
261-
".mill-version" -> """0.9.5""",
261+
".mill-version" -> "0.9.5 \n ",
262262
".travis.yml" -> """- TEST_MILL_VERSION=0.9.5"""
263263
)
264264
val expected = Map(

0 commit comments

Comments
 (0)