nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: scala-steward-org/scala-steward
Pull request #3349 (2024-05-07 08:10:00)

fix azure repos targetRefName
#3348 


Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/forge/azurerepos/JsonCodec.scala b/modules/core/src/main/scala/org/scalasteward/core/forge/azurerepos/JsonCodec.scala
index 8be29111..91539d9b 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/forge/azurerepos/JsonCodec.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/forge/azurerepos/JsonCodec.scala
@@ -38,7 +38,7 @@ private[azurerepos] object PullRequestPayload {
   def from(data: NewPullRequestData): PullRequestPayload =
     PullRequestPayload(
       sourceRefName = withPrefix(data.head),
-      targetRefName = data.base.name,
+      targetRefName = withPrefix(data.base.name),
       title = data.title,
       labels = Option.when(data.labels.nonEmpty)(data.labels),
       description = data.body


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlgTest.scala
index c30d67fd..5b486f16 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/AzureReposApiAlgTest.scala
@@ -209,7 +209,7 @@ class AzureReposApiAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] {
           title = "Update cats-effect to 3.3.14",
           body = "Updates org.typelevel:cats-effect  from 3.3.13 to 3.3.14.",
           head = "refs/heads/update/cats-effect-3.3.14",
-          base = Branch("refs/heads/main"),
+          base = Branch("main"),
           labels = List.empty,
           assignees = List.empty,
           reviewers = List.empty
diff --git a/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/JsonCodecTest.scala b/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/JsonCodecTest.scala
index 07ae4ee6..8c39f59f 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/JsonCodecTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/forge/azurerepos/JsonCodecTest.scala
@@ -24,7 +24,7 @@ class JsonCodecTest extends FunSuite {
     val expected =
       json"""{
                "sourceRefName" : "refs/heads/source",
-               "targetRefName" : "main",
+               "targetRefName" : "refs/heads/main",
                "title" : "Test MR title",
                "labels" : null,
                "description" : "Test MR body"
@@ -38,7 +38,7 @@ class JsonCodecTest extends FunSuite {
     val expected =
       json"""{
                "sourceRefName" : "refs/heads/source",
-               "targetRefName" : "main",
+               "targetRefName" : "refs/heads/main",
                "title" : "Test MR title",
                "labels" : [ "foo", "bar" ],
                "description" : "Test MR body"
Repository: scala-steward-org/scala-steward
Pull request #3377 (2024-06-25 03:07:47)

Fix exit code policy
Aligning expectation that "all repos succeed" means there are no repos with failures.

This brings back the old behavior from RunResults:

    if (reposWithFailures.isEmpty) ExitCode.Success else ExitCode.Error

See:
https://github.com/scala-steward-org/scala-steward/compare/6259adb0...9d9460af


Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/application/ExitCodePolicy.scala b/modules/core/src/main/scala/org/scalasteward/core/application/ExitCodePolicy.scala
index 9edcf1a7..7150b58a 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/application/ExitCodePolicy.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/application/ExitCodePolicy.scala
@@ -28,5 +28,5 @@ object ExitCodePolicy {
 
   val SuccessIfAnyRepoSucceeds: ExitCodePolicy = successIf(_.successRepos.nonEmpty)
 
-  val SuccessOnlyIfAllReposSucceed: ExitCodePolicy = successIf(_.reposWithFailures.nonEmpty)
+  val SuccessOnlyIfAllReposSucceed: ExitCodePolicy = successIf(_.reposWithFailures.isEmpty)
 }


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/application/StewardAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/application/StewardAlgTest.scala
index 72a194e7..1e686cac 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/application/StewardAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/application/StewardAlgTest.scala
@@ -8,9 +8,6 @@ import org.scalasteward.core.mock.{MockConfig, MockState}
 class StewardAlgTest extends CatsEffectSuite {
   test("runF") {
     val exitCode = stewardAlg.runF.runA(MockState.empty.addUris(MockConfig.reposFile -> ""))
-    assertIO(
-      exitCode,
-      ExitCode.Error
-    ) // We have not passed any repos to Scala Steward therefore it's reasonable that it will return error code.
+    assertIO(exitCode, ExitCode.Success)
   }
 }
Repository: scala-steward-org/scala-steward
Pull request #3541 (2025-01-13 06:43:15)

Short-circuit when reading `mill-version` files
If a `.mill-version` exists there is no need to also read `.config/mill-version` and then discard its content.


Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/buildtool/mill/MillAlg.scala b/modules/core/src/main/scala/org/scalasteward/core/buildtool/mill/MillAlg.scala
index f5908025..0e101ee8 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/buildtool/mill/MillAlg.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/buildtool/mill/MillAlg.scala
@@ -92,13 +92,10 @@ final class MillAlg[F[_]](defaultResolver: Resolver)(implicit
     Some("https://github.com/scala-steward-org/scala-steward/issues/2838")
 
   private def getMillVersion(buildRootDir: File): F[Option[Version]] =
-    for {
-      millVersionFileContent <- fileAlg.readFile(buildRootDir / s".$millVersionName")
-      millVersionFileInConfigContent <- fileAlg.readFile(buildRootDir / ".config" / millVersionName)
-      version = millVersionFileContent
-        .orElse(millVersionFileInConfigContent)
-        .flatMap(parser.parseMillVersion)
-    } yield version
+    List(
+      buildRootDir / s".$millVersionName",
+      buildRootDir / ".config" / millVersionName
+    ).collectFirstSomeM(fileAlg.readFile).map(_.flatMap(parser.parseMillVersion))
 
   private def getMillPluginDeps(
       millVersion: Version,
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index fd64f592..320df96b 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -13,7 +13,7 @@ object Dependencies {
   val circeParser = "io.circe" %% "circe-parser" % circeGeneric.revision
   val circeRefined = "io.circe" %% "circe-refined" % "0.15.1"
   val commonsIo = "commons-io" % "commons-io" % "2.18.0"
-  val coursierCore = "io.get-coursier" %% "coursier" % "2.1.24"
+  val coursierCore = "io.get-coursier" %% "coursier" % "2.1.23"
   val coursierSbtMaven =
     "io.get-coursier" %% "coursier-sbt-maven-repository" % coursierCore.revision
   val cron4sCore = "com.github.alonsodomin.cron4s" %% "cron4s-core" % "0.7.0"


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/buildtool/mill/MillAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/buildtool/mill/MillAlgTest.scala
index 59145ad4..61274073 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/buildtool/mill/MillAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/buildtool/mill/MillAlgTest.scala
@@ -57,7 +57,6 @@ class MillAlgTest extends FunSuite {
     val expected = initial.copy(
       trace = Vector(
         Cmd("read", s"$repoDir/.mill-version"),
-        Cmd("read", s"$repoDir/.config/mill-version"),
         millCmd,
         Cmd("read", s"$repoDir/build.sc")
       )
Repository: scala-steward-org/scala-steward
Pull request #3574 (2025-02-02 12:38:33)

Disable built-in Scala CLI rules in Scalafix migrations
When running Scalafix migrations in Scala CLI builds, we disable [built-in Scala CLI rules](https://scala-cli.virtuslab.org/docs/commands/fix/#built-in-rules) so that any changes are only coming from the Scalafix migrations.

See https://github.com/scala-steward-org/scala-steward/issues/3486#issuecomment-2629120439.


Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlg.scala b/modules/core/src/main/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlg.scala
index 71ffee17..2dc7d4ac 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlg.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlg.scala
@@ -95,8 +95,13 @@ final class ScalaCliAlg[F[_]](implicit
   override def runMigration(buildRoot: BuildRoot, migration: ScalafixMigration): F[Unit] =
     for {
       buildRootDir <- workspaceAlg.buildRootDir(buildRoot)
-      cmd = Nel.of("scala-cli", "--power", "fix", "--scalafix-rules") :::
-        migration.rewriteRules.append(buildRootDir.pathAsString)
+      cmd = Nel.of(
+        "scala-cli",
+        "--power",
+        "fix",
+        "--enable-built-in-rules=false",
+        "--scalafix-rules"
+      ) ::: migration.rewriteRules.append(buildRootDir.pathAsString)
       slurpOptions = SlurpOptions.ignoreBufferOverflow
       _ <- processAlg.execSandboxed(cmd, buildRootDir, slurpOptions = slurpOptions)
     } yield ()


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlgTest.scala
index 0ad9aff9..e4b0d84b 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/buildtool/scalacli/ScalaCliAlgTest.scala
@@ -102,6 +102,7 @@ class ScalaCliAlgTest extends CatsEffectSuite {
           "scala-cli",
           "--power",
           "fix",
+          "--enable-built-in-rules=false",
           "--scalafix-rules",
           "github:functional-streams-for-scala/fs2/v1?sha=v1.0.5",
           buildRootDir.pathAsString