Skip to content

Commit

Permalink
use Scalafmt latest version (won't build with Java 8) (#3622)
Browse files Browse the repository at this point in the history
Scalafmt needs to be updated to support the latest scala 3 syntax.

according to the now-deleted comment, this version was frozen because of
supporting building with JDK 8, but if 0.12.0 will drop JDK 8 support
then why not update
  • Loading branch information
bishabosha authored Sep 28, 2024
1 parent 55f02d9 commit 8ed5721
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Newer versions won't work with Java 8!
version = "3.7.15"
version = "3.8.3"

align.openParenCallSite = false
align.preset = none
Expand Down
4 changes: 2 additions & 2 deletions bsp/src/mill/bsp/BspWorker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ private object BspWorker {
urls
}.getOrElse {
// load extra classpath entries from file
val cpFile =
workspace / Constants.bspDir / s"${Constants.serverName}-${mill.main.BuildInfo.millVersion}.resources"
val resources = s"${Constants.serverName}-${mill.main.BuildInfo.millVersion}.resources"
val cpFile = workspace / Constants.bspDir / resources
if (!os.exists(cpFile)) return Left(
"You need to run `mill mill.bsp.BSP/install` before you can use the BSP server"
)
Expand Down
7 changes: 4 additions & 3 deletions contrib/buildinfo/src/mill/contrib/buildinfo/BuildInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ object BuildInfo {
case v =>
if (isScala)
s"""${commentStr(v)}val ${v.key} = buildInfoProperties.getProperty("${v.key}")"""
else s"""${commentStr(
v
)}public static final java.lang.String ${v.key} = buildInfoProperties.getProperty("${v.key}");"""
else {
val propValue = s"""buildInfoProperties.getProperty("${v.key}")"""
s"""${commentStr(v)}public static final java.lang.String ${v.key} = $propValue;"""
}
}
.mkString("\n\n ")

Expand Down
5 changes: 4 additions & 1 deletion main/util/src/mill/util/PromptLoggerUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ private object PromptLoggerUtil {
// as the `headerPrefixStr` changes, even at the expense of it not being perfectly centered.
val leftDivider = "=" * ((maxWidth / 2) - (titleText.length / 2) - headerPrefixStr.length + 2)
val rightDivider =
"=" * (maxWidth - headerPrefixStr.length - leftDivider.length - shortenedTitle.length - headerSuffixStr.length)
"=" * (
maxWidth - headerPrefixStr.length - leftDivider.length -
shortenedTitle.length - headerSuffixStr.length
)
val headerString =
headerPrefixStr + leftDivider + shortenedTitle + rightDivider + headerSuffixStr
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ class ZincWorkerImpl(
val combinedCompilerClasspath = compilerClasspath ++ scalacPluginClasspath
val javacRuntimeOptions = javacOptions.filter(filterJavacRuntimeOptions)
val compilersSig =
combinedCompilerClasspath.hashCode() + scalaVersion.hashCode() + scalaOrganization.hashCode() + javacRuntimeOptions.hashCode()
combinedCompilerClasspath.hashCode() + scalaVersion.hashCode() +
scalaOrganization.hashCode() + javacRuntimeOptions.hashCode()
val combinedCompilerJars = combinedCompilerClasspath.iterator.map(_.path.toIO).toArray

val compiledCompilerBridge = compileBridgeIfNeeded(
Expand Down

0 comments on commit 8ed5721

Please sign in to comment.