Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalafmt-core to 3.8.5 #1673

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.8.3
fb3b1e158c70f5b76207764dc42b128cb878b3be

# Scala Steward: Reformat with scalafmt 3.8.5
3308376668ff617498c3f45a24276d77292a3f83
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Version https://scalameta.org/scalafmt/docs/configuration.html#version
version = 3.8.3
version = 3.8.5
# Dialect https://scalameta.org/scalafmt/docs/configuration.html#scala-dialects
runner.dialect = scala212source3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ object JavaAppPackaging extends AutoPlugin {
for {
(_, name) <- mappings
} yield
// Here we want the name relative to the lib/ folder...
// For now we just cheat...
if (name startsWith "lib/") name drop 4
else "../" + name
// Here we want the name relative to the lib/ folder...
// For now we just cheat...
if (name startsWith "lib/") name drop 4
else "../" + name

/**
* Constructs a jar name from components...(ModuleID/Artifact)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ object JavaServerAppPackaging extends AutoPlugin {
Seq(
Linux / javaOptions := (Universal / javaOptions).value,
// === logging directory mapping ===
linuxPackageMappings += {
linuxPackageMappings +=
packageTemplateMapping(defaultLinuxLogsLocation.value + "/" + (Linux / packageName).value)()
.withUser((Linux / daemonUser).value)
.withGroup((Linux / daemonGroup).value)
.withPerms("755")
},
.withPerms("755"),
linuxPackageSymlinks += {
val name = (Linux / packageName).value
LinuxSymlink(
Expand Down Expand Up @@ -126,12 +125,11 @@ object JavaServerAppPackaging extends AutoPlugin {
linuxScriptReplacements ++= bashScriptEnvConfigLocation.value.map(ENV_CONFIG_REPLACEMENT -> _).toSeq,
linuxScriptReplacements += Names.DaemonStdoutLogFileReplacement -> daemonStdoutLogFile.value.getOrElse(""),
// === /var/run/app pid folder ===
linuxPackageMappings += {
linuxPackageMappings +=
packageTemplateMapping("/var/run/" + packageName.value)()
.withUser(daemonUser.value)
.withGroup(daemonGroup.value)
.withPerms("755")
}
)
) ++ Seq(
// === Daemon User and Group ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ object JDebPackaging extends AutoPlugin with DebianPluginLike {
def jdebSettings =
Seq(
// FIXME do nothing. Java7 posix needed
debianConffilesFile := {
target.value / Names.DebianMaintainerScripts / Names.Conffiles
},
debianConffilesFile :=
target.value / Names.DebianMaintainerScripts / Names.Conffiles,
// FIXME copied from the debian plugin. Java7 posix needed
debianControlFile := {
val data = debianPackageMetadata.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,15 @@ object DockerPlugin extends AutoPlugin {
Seq("-t", alias.toString)
} ++ { if (dockerBuildInit.value) List("--init") else Nil },
dockerBuildEnvVars := Map.empty,
dockerBuildkitEnabled := {
dockerBuildkitEnabled :=
dockerBuildEnvVars.value
.get("DOCKER_BUILDKIT")
.orElse(sys.env.get("DOCKER_BUILDKIT"))
.map(_ == "1")
.getOrElse {
// BuildKit is the default since v23.0
dockerVersion.value.fold(false)(_.major >= 23)
}
},
},
dockerRmiCommand := dockerExecCommand.value ++ Seq("rmi"),
dockerBuildCommand := dockerExecCommand.value ++ Seq("build") ++ dockerBuildOptions.value ++ Seq("."),
dockerAdditionalPermissions := {
Expand Down Expand Up @@ -269,7 +268,7 @@ object DockerPlugin extends AutoPlugin {

stage0 ++ stage1
}
) ++ mapGenericFilesToDocker ++ inConfig(Docker)({
) ++ mapGenericFilesToDocker ++ inConfig(Docker) {

def publishLocalTask =
Def.task {
Expand Down Expand Up @@ -383,7 +382,7 @@ object DockerPlugin extends AutoPlugin {
generateDockerConfig(dockerCommands.value, stagingDirectory.value)
}
)
})
}

/**
* @param maintainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ object ClasspathJarPlugin extends AutoPlugin {
moduleId.organization + "." + artifact.name + "-" + moduleId.revision +
artifact.classifier.fold("")("-" + _) + "." + artifact.extension
},
bashScriptDefines / scriptClasspath := {
Seq(PluginCompat.getArtifactPathName((packageJavaClasspathJar / artifactPath).value))
},
batScriptReplacements / scriptClasspath := {
Seq(PluginCompat.getArtifactPathName((packageJavaClasspathJar / artifactPath).value))
},
bashScriptDefines / scriptClasspath :=
Seq(PluginCompat.getArtifactPathName((packageJavaClasspathJar / artifactPath).value)),
batScriptReplacements / scriptClasspath :=
Seq(PluginCompat.getArtifactPathName((packageJavaClasspathJar / artifactPath).value)),
Universal / mappings += {
val classpathJar = packageJavaClasspathJar.value
classpathJar -> ("lib/" + PluginCompat.getName(classpathJar))
Expand Down
8 changes: 5 additions & 3 deletions src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ object RpmHelper {
LinuxSymlink.makeSymLinks(spec.symlinks, buildroot, relativeLinks = false)
}

private[this] def writeSpecFile(spec: RpmSpec, workArea: File, log: sbt.Logger)(implicit
conv: FileConverter
): File = {
private[this] def writeSpecFile(
spec: RpmSpec,
workArea: File,
log: sbt.Logger
)(implicit conv: FileConverter): File = {
val specdir = workArea / "SPECS"
val rpmBuildroot = workArea / "buildroot"
val tmpBuildRoot = workArea / "tmp-buildroot"
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/file-permissions/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

linuxPackageMappings += packageMapping(
((Compile / resourceDirectory).value / "sudoers.d", "/etc/sudoers.d")
).withPerms("0440").asDocs()
linuxPackageMappings += packageMapping(((Compile / resourceDirectory).value / "sudoers.d", "/etc/sudoers.d"))
.withPerms("0440")
.asDocs()
4 changes: 3 additions & 1 deletion src/sbt-test/jdkpackager/test-package-image/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ lazy val iconGlob = sys.props("os.name").toLowerCase match {
case _ => "*.png"
}

jdkAppIcon := (baseDirectory.value / ".." / ".." / ".." / ".." / "test-project-jdkpackager" ** iconGlob).getPaths().headOption
jdkAppIcon := (baseDirectory.value / ".." / ".." / ".." / ".." / "test-project-jdkpackager" ** iconGlob)
.getPaths()
.headOption
.map(file)

TaskKey[Unit]("checkImage") := {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import scala.collection.JavaConversions._
/** Silly GUI app launcher. */
object ExampleApp {
def main(args: Array[String]): Unit =
Application.launch(classOf[ExampleApp], args: _*)
Application.launch(classOf[ExampleApp], args*)
}

/** Silly GUI app. */
Expand Down
4 changes: 3 additions & 1 deletion src/sbt-test/jdkpackager/test-package-mappings/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ lazy val iconGlob = sys.props("os.name").toLowerCase match {
case _ => "*.png"
}

jdkAppIcon := (baseDirectory.value / ".." / ".." / ".." / ".." / "test-project-jdkpackager" ** iconGlob).getPaths().headOption
jdkAppIcon := (baseDirectory.value / ".." / ".." / ".." / ".." / "test-project-jdkpackager" ** iconGlob)
.getPaths()
.headOption
.map(file)

TaskKey[Unit]("checkImage") := {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import javafx.stage.{Modality, Stage, StageStyle}
/** Silly GUI app launcher. */
object ExampleApp {
def main(args: Array[String]): Unit =
Application.launch(classOf[ExampleApp], args: _*)
Application.launch(classOf[ExampleApp], args*)
}

/** Silly GUI app. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import javafx.stage.{Modality, Stage, StageStyle}
/** Silly GUI app launcher. */
object ExampleApp {
def main(args: Array[String]): Unit =
Application.launch(classOf[ExampleApp], args: _*)
Application.launch(classOf[ExampleApp], args*)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scala-steward this breaks the test 😒

}

/** Silly GUI app. */
Expand Down
3 changes: 2 additions & 1 deletion src/sbt-test/jlink/test-jlink-misc/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ val issue1293 = project
(jlinkBuildImage / fullClasspath).value
// Find the ones that have `paranamer` as their artifact names.
.filter { item =>
item.get(PluginCompat.moduleIDStr)
item
.get(PluginCompat.moduleIDStr)
.map(PluginCompat.parseModuleIDStrAttribute)
.exists { modId =>
modId.name == "paranamer"
Expand Down
18 changes: 10 additions & 8 deletions src/sbt-test/universal/multiproject-classifiers/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import xsbti.FileConverter

lazy val appVersion = "1.0"

lazy val mySettings: Seq[Setting[_]] =
lazy val mySettings: Seq[Setting[?]] =
Seq(
organization := "org.test",
version := appVersion,
TaskKey[Unit]("showFiles") := {
TaskKey[Unit]("showFiles") :=
System.out.synchronized {
println("Files in [" + name.value + "]")
val files = (target.value / "universal/stage").**(AllPassFilter).get()
files foreach println
}
}
)

lazy val Assets = config("assets")
Expand All @@ -37,11 +36,14 @@ lazy val sub = project
Assets / exportedProducts := {
implicit val converter: FileConverter = fileConverter.value
val assetsDir = baseDirectory.value / "src" / "main" / "assets"
assetsDir.**(AllPassFilter).filter(_.isFile).classpath.map(
_
.put(PluginCompat.artifactStr, PluginCompat.artifactToStr((Assets / artifact).value))
.put(PluginCompat.moduleIDStr, PluginCompat.moduleIDToStr(projectID.value))
)
assetsDir
.**(AllPassFilter)
.filter(_.isFile)
.classpath
.map(
_.put(PluginCompat.artifactStr, PluginCompat.artifactToStr((Assets / artifact).value))
.put(PluginCompat.moduleIDStr, PluginCompat.moduleIDToStr(projectID.value))
)
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ class ScriptUtilsTest extends AnyFlatSpec with Matchers {
testMapping("pkg1.Test" -> "test")
}

it should "be consistent with the docs" in {
it should "be consistent with the docs" in
// see src/sphinx/archetypes/java_app/index.rst
testMapping(
"pkg1.TestClass" -> "pkg-1_test-class",
"pkg2.AnUIMainClass" -> "an-ui-main-class",
"pkg2.SomeXMLLoader" -> "some-xml-loader",
"pkg3.TestClass" -> "pkg-3_test-class"
)
}

"duplicated script name detector" should "work" in {
ScriptUtils.describeDuplicates(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,73 +29,58 @@ class ZipHelperSpec extends AnyWordSpec with Matchers with BeforeAndAfterEach wi

"The ZipHelper.zip" should {

"create a zip with a single file" taggedAs (LinuxTag, WindowsTag) in {
"create a zip with a single file" taggedAs (LinuxTag, WindowsTag) in
zipSingleFile(ZipHelper.zip)
}

"create a zip with nested directories" taggedAs (LinuxTag, WindowsTag) in {
"create a zip with nested directories" taggedAs (LinuxTag, WindowsTag) in
zipNestedFile(ZipHelper.zip)
}

"create a zip with nested directories containing file" taggedAs (LinuxTag, WindowsTag) in {
"create a zip with nested directories containing file" taggedAs (LinuxTag, WindowsTag) in
zipNestedDirsWithFiles(ZipHelper.zip)
}

"create directories if necessary" taggedAs (LinuxTag, WindowsTag) in {
"create directories if necessary" taggedAs (LinuxTag, WindowsTag) in
createNecessaryDirectories(ZipHelper.zip)
}

// works only on some systems
"preserve the executable bit" taggedAs (LinuxTag, WindowsTag) ignore {
"preserve the executable bit" taggedAs (LinuxTag, WindowsTag) ignore
preserveExecutableBit(ZipHelper.zip)
}
}

"The ZipHelper.zipNIO" should {

"create a zip with a single file" taggedAs (LinuxTag, WindowsTag) in {
"create a zip with a single file" taggedAs (LinuxTag, WindowsTag) in
zipSingleFile(ZipHelper.zipNIO)
}

"create a zip with nested directories" taggedAs (LinuxTag, WindowsTag) in {
"create a zip with nested directories" taggedAs (LinuxTag, WindowsTag) in
zipNestedFile(ZipHelper.zipNIO)
}

"create a zip with nested directories containing file" taggedAs (LinuxTag, WindowsTag) in {
"create a zip with nested directories containing file" taggedAs (LinuxTag, WindowsTag) in
zipNestedDirsWithFiles(ZipHelper.zipNIO)
}

"create directories if necessary" taggedAs (LinuxTag, WindowsTag) in {
"create directories if necessary" taggedAs (LinuxTag, WindowsTag) in
createNecessaryDirectories(ZipHelper.zipNIO)
}

// never works
"preserve the executable bit" taggedAs (LinuxTag, WindowsTag) ignore {
"preserve the executable bit" taggedAs (LinuxTag, WindowsTag) ignore
preserveExecutableBit(ZipHelper.zipNIO)
}
}

"The ZipHelper.zipNative" should {
"create a zip with a single file" taggedAs (LinuxTag) in {
"create a zip with a single file" taggedAs (LinuxTag) in
zipSingleFile(ZipHelper.zipNative)
}

"create a zip with nested directories" taggedAs (LinuxTag) in {
"create a zip with nested directories" taggedAs (LinuxTag) in
zipNestedFile(ZipHelper.zipNative)
}

"create a zip with nested directories containing file" taggedAs (LinuxTag) in {
"create a zip with nested directories containing file" taggedAs (LinuxTag) in
zipNestedDirsWithFiles(ZipHelper.zipNative)
}

"create directories if necessary" taggedAs (LinuxTag) in {
"create directories if necessary" taggedAs (LinuxTag) in
createNecessaryDirectories(ZipHelper.zipNative)
}

// never works
"preserve the executable bit" taggedAs (LinuxTag) ignore {
"preserve the executable bit" taggedAs (LinuxTag) ignore
preserveExecutableBit(ZipHelper.zipNative)
}
}

/* ========================================================== */
Expand Down
2 changes: 1 addition & 1 deletion test-project-jdkpackager/src/main/scala/ExampleApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import javafx.stage.{Modality, Stage, StageStyle}
/** Silly GUI app launcher. */
object ExampleApp {
def main(args: Array[String]): Unit =
Application.launch(classOf[ExampleApp], args: _*)
Application.launch(classOf[ExampleApp], args*)
}

/** Silly GUI app. */
Expand Down
Loading