From a5103d8921c92fda6ca5cc0e807105baee51cb3b Mon Sep 17 00:00:00 2001 From: "scala-center-steward[bot]" <111975575+scala-center-steward[bot]@users.noreply.github.com> Date: Sun, 18 Jan 2026 00:18:05 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.10.4 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 94f0d77..44e0ff7 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.10.3" +version = "3.10.4" runner.dialect = scala213 maxColumn = 100 docstrings.style = Asterisk From 8b4cde6f77c4192809208de1b8c11e57e36c6f71 Mon Sep 17 00:00:00 2001 From: "scala-center-steward[bot]" <111975575+scala-center-steward[bot]@users.noreply.github.com> Date: Sun, 18 Jan 2026 00:18:08 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.10.4 Executed command: scalafmt --non-interactive --- .../maven/MojoImplementation.scala | 7 +- .../maven/MavenConfigGenerationTest.scala | 84 ++++++++++++------- 2 files changed, 58 insertions(+), 33 deletions(-) diff --git a/src/main/scala/bloop/integrations/maven/MojoImplementation.scala b/src/main/scala/bloop/integrations/maven/MojoImplementation.scala index 62d183b..d57dd3a 100644 --- a/src/main/scala/bloop/integrations/maven/MojoImplementation.scala +++ b/src/main/scala/bloop/integrations/maven/MojoImplementation.scala @@ -255,7 +255,8 @@ object MojoImplementation { } val (modules, extraClasspath) = { - val hasJunit = allArtifacts.exists(a => a.getGroupId == "junit" && a.getArtifactId == "junit") + val hasJunit = + allArtifacts.exists(a => a.getGroupId == "junit" && a.getArtifactId == "junit") val hasJunitInterface = allArtifacts.exists(a => a.getArtifactId == "junit-interface") if (hasJunit && !hasJunitInterface && configuration == "test") { val junitInterfaceVersion = "0.13.3" @@ -347,7 +348,9 @@ object MojoImplementation { log.debug(s"Configuration to be serialized:\n$config") bloop.config.write(config, configTarget.toPath) - log.info(s"Starting to write configuration for project: ${project.getArtifactId()} with configuration: $configuration") + log.info( + s"Starting to write configuration for project: ${project.getArtifactId()} with configuration: $configuration" + ) log.debug(s"Source directories: ${sourceDirs0.map(_.getAbsolutePath).mkString(", ")}") log.debug(s"Classpath: ${classpath0().asScala.mkString(", ")}") log.debug(s"Resources: ${resources0.asScala.mkString(", ")}") diff --git a/src/test/scala/bloop/integrations/maven/MavenConfigGenerationTest.scala b/src/test/scala/bloop/integrations/maven/MavenConfigGenerationTest.scala index 09143db..d98fb72 100644 --- a/src/test/scala/bloop/integrations/maven/MavenConfigGenerationTest.scala +++ b/src/test/scala/bloop/integrations/maven/MavenConfigGenerationTest.scala @@ -214,22 +214,26 @@ class MavenConfigGenerationTest extends BaseConfigSuite { case (configFile, projectName, List(module1, module2)) => // module1 is "module1" // module2 is "module1-test" - + // module1's test configuration should be renamed to avoid conflict with module2 // Default would be "module1-test", but "module1-test" exists as a reactor artifact (module2) // So it should be "module1-test-scope" assertEquals("module1", module1.project.name) - + // We need to check the test configuration name for module1. // check() function loads the "compile" configuration (default expectation in this test suite assumption?) // Actually check() loads the config based on the project file name. // module1 comes from "conflicting_modules/module1/pom.xml" -> parent dir is "module1". // The bloop file loaded is "module1.json". - + // Let's check the test config of module1 - val module1TestConfigPath = configFile.project.directory.resolve(".bloop").resolve("module1-test-scope.json") - assertTrue(s"Test config for module1 should be renamed to module1-test-scope.json", Files.exists(module1TestConfigPath)) - + val module1TestConfigPath = + configFile.project.directory.resolve(".bloop").resolve("module1-test-scope.json") + assertTrue( + s"Test config for module1 should be renamed to module1-test-scope.json", + Files.exists(module1TestConfigPath) + ) + val module1TestConfig = readValidBloopConfig(module1TestConfigPath.toFile()) assertEquals("module1-test-scope", module1TestConfig.project.name) @@ -310,15 +314,15 @@ class MavenConfigGenerationTest extends BaseConfigSuite { case List(m1, m2) => (m1, m2) case _ => fail(s"Expected 2 submodules, but got ${submodulesList.size}") } - + // Standard naming should be preserved when no collision exists assert(!configFile.project.name.contains("-compile")) assert(!module1.project.name.contains("-compile")) assert(!module2.project.name.contains("-compile")) - - // Note: To test actual collision, we would need to construct a project structure - // where a submodule name conflicts with the test suffix of another module. - // For now, we verify that the default behavior is correct (no suffixes). + + // Note: To test actual collision, we would need to construct a project structure + // where a submodule name conflicts with the test suffix of another module. + // For now, we verify that the default behavior is correct (no suffixes). } } @@ -326,32 +330,46 @@ class MavenConfigGenerationTest extends BaseConfigSuite { def junitSupport() = { check("junit_project/pom.xml") { (configFile, projectName, subprojects) => assert(subprojects.isEmpty) - + // Read the test configuration file - val testConfigFile = readValidBloopConfig(configFile.project.directory.resolve(".bloop").resolve(s"$projectName-test.json").toFile()) - + val testConfigFile = readValidBloopConfig( + configFile.project.directory.resolve(".bloop").resolve(s"$projectName-test.json").toFile() + ) + // Check if junit-interface is present in the resolution modules of the test config val resolutionModules = testConfigFile.project.resolution.get.modules val hasJunitInterface = resolutionModules.exists(_.name.contains("junit-interface")) - - assertTrue("junit-interface should be present in test config when junit is used", hasJunitInterface) - + + assertTrue( + "junit-interface should be present in test config when junit is used", + hasJunitInterface + ) + // Also check classpath - val hasJunitInterfaceInClasspath = testConfigFile.project.classpath.exists(_.toString.contains("junit-interface")) - assertTrue("junit-interface should be present in test classpath when junit is used", hasJunitInterfaceInClasspath) + val hasJunitInterfaceInClasspath = + testConfigFile.project.classpath.exists(_.toString.contains("junit-interface")) + assertTrue( + "junit-interface should be present in test classpath when junit is used", + hasJunitInterfaceInClasspath + ) } } - private def check(testProject: String, submodules: List[String] = Nil, extraContent: Map[String, String] = Map.empty)( + private def check( + testProject: String, + submodules: List[String] = Nil, + extraContent: Map[String, String] = Map.empty + )( checking: (Config.File, String, List[Config.File]) => Unit ): Unit = { println(s"Checking $testProject") val tempDir = Files.createTempDirectory("mavenBloop") val outFile = copyFromResource(tempDir, testProject) - extraContent.foreach { case (relativePath, content) => - val p = tempDir.resolve(relativePath) - Files.createDirectories(p.getParent) - Files.write(p, content.getBytes("UTF-8")) + extraContent.foreach { + case (relativePath, content) => + val p = tempDir.resolve(relativePath) + Files.createDirectories(p.getParent) + Files.write(p, content.getBytes("UTF-8")) } submodules.foreach(copyFromResource(tempDir, _)) val wrapperJar = copyFromResource(tempDir, s"maven-wrapper.jar") @@ -443,8 +461,6 @@ class MavenConfigGenerationTest extends BaseConfigSuite { } } - - @Test def withIncludes() = { check( @@ -456,17 +472,20 @@ class MavenConfigGenerationTest extends BaseConfigSuite { ) { (configFile, projectName, subprojects) => assert(subprojects.isEmpty) val resources = configFile.project.resources.getOrElse(Nil) - + val included = resources.find(_.toString.endsWith("included.txt")) val excluded = resources.find(_.toString.endsWith("excluded.txt")) - + assert(included.isDefined, "included.txt should be in resources") assert(excluded.isEmpty, "excluded.txt should NOT be in resources") // Ensure the directory itself is not added when we have explicit includes val resourceDir = configFile.project.directory.resolve("src/main/resources").toAbsolutePath val hasResourceDir = resources.exists(_.toAbsolutePath == resourceDir) - assert(!hasResourceDir, s"Resource directory $resourceDir should NOT be in resources when includes are specified") + assert( + !hasResourceDir, + s"Resource directory $resourceDir should NOT be in resources when includes are specified" + ) } } @@ -488,7 +507,10 @@ class MavenConfigGenerationTest extends BaseConfigSuite { val baseDirectory = configFile.project.directory.toAbsolutePath val hasBaseDir = resources.exists(_.toAbsolutePath == baseDirectory) - assert(!hasBaseDir, s"Base directory $baseDirectory should NOT be in resources when includes are specified") + assert( + !hasBaseDir, + s"Base directory $baseDirectory should NOT be in resources when includes are specified" + ) } } @@ -506,7 +528,7 @@ class MavenConfigGenerationTest extends BaseConfigSuite { val resourceDir = configFile.project.directory.resolve("src/main/resources").toAbsolutePath val hasResourceDir = resources.exists(_.toAbsolutePath == resourceDir) assert(hasResourceDir, s"Resource directory $resourceDir SHOULD be in resources") - + // Individual files should NOT be listed val hasFile = resources.exists(_.toString.endsWith("hello.txt")) assert(!hasFile, "Individual files inside resource dir should NOT be in resources list") From fd8acfb249cacf5eef7b4525375c59415241d7bd Mon Sep 17 00:00:00 2001 From: "scala-center-steward[bot]" <111975575+scala-center-steward[bot]@users.noreply.github.com> Date: Sun, 18 Jan 2026 00:18:08 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.10.4' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 6cd1994..e9eb00a 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,5 @@ # Scala Steward: Reformat with scalafmt 3.7.0 9918d3ef687de71b9006c3989cd4306212f7ff63 + +# Scala Steward: Reformat with scalafmt 3.10.4 +8b4cde6f77c4192809208de1b8c11e57e36c6f71