Skip to content

Commit b38bb46

Browse files
Update scalafmt-cli_2.13, scalafmt-core to 3.8.5 (#3442)
* Update scalafmt-cli_2.13, scalafmt-core to 3.8.5 * Reformat with scalafmt 3.8.5 Executed command: scalafmt --non-interactive * Add 'Reformat with scalafmt 3.8.5' to .git-blame-ignore-revs * Update reference docs --------- Co-authored-by: Piotr Chabelski <[email protected]>
1 parent e40216f commit b38bb46

File tree

15 files changed

+52
-38
lines changed

15 files changed

+52
-38
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66

77
# Scala Steward: Reformat with scalafmt 3.8.3
88
52b913a12d8abdff1b340db668ebe38c59b423e4
9+
10+
# Scala Steward: Reformat with scalafmt 3.8.5
11+
74f069ccdaa91872cb77dc1f902752221d588db1

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.8.3"
1+
version = "3.8.5"
22

33
align.preset = more
44
maxColumn = 100

modules/build/src/main/scala/scala/build/bsp/BspClient.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ class BspClient(
199199
}
200200
.groupBy(_.positions.headOption match
201201
case Some(File(Right(path), _, _, _)) => Some(path)
202-
case _ => None
203-
)
202+
case _ => None)
204203
.filter(_._1.isDefined)
205204
.values
206205
.toSeq

modules/cli/src/main/scala/scala/cli/commands/publish/checks/PasswordCheck.scala

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,15 @@ final case class PasswordCheck(
4444
}
4545

4646
def check(pubOpt: BPublishOptions): Boolean =
47-
pubOpt.retained(options.publishParams.setupCi).repoPassword.nonEmpty || {
48-
!options.publishParams.setupCi && (passwordOpt(pubOpt) match {
49-
case Left(ex) =>
50-
logger.debug("Ignoring error while trying to get password from config")
51-
logger.debug(ex)
52-
true
53-
case Right(valueOpt) =>
54-
valueOpt.isDefined
55-
})
56-
}
47+
pubOpt.retained(options.publishParams.setupCi).repoPassword.nonEmpty ||
48+
!options.publishParams.setupCi && (passwordOpt(pubOpt) match {
49+
case Left(ex) =>
50+
logger.debug("Ignoring error while trying to get password from config")
51+
logger.debug(ex)
52+
true
53+
case Right(valueOpt) =>
54+
valueOpt.isDefined
55+
})
5756

5857
def defaultValue(pubOpt: BPublishOptions): Either[BuildException, OptionCheck.DefaultValue] =
5958
either {

modules/cli/src/main/scala/scala/cli/commands/publish/checks/UserCheck.scala

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,15 @@ final case class UserCheck(
4545
}
4646

4747
def check(pubOpt: BPublishOptions): Boolean =
48-
pubOpt.retained(options.publishParams.setupCi).repoUser.nonEmpty || {
49-
!options.publishParams.setupCi && (userOpt(pubOpt) match {
50-
case Left(ex) =>
51-
logger.debug("Ignoring error while trying to get user from config")
52-
logger.debug(ex)
53-
true
54-
case Right(valueOpt) =>
55-
valueOpt.isDefined
56-
})
57-
}
48+
pubOpt.retained(options.publishParams.setupCi).repoUser.nonEmpty ||
49+
!options.publishParams.setupCi && (userOpt(pubOpt) match {
50+
case Left(ex) =>
51+
logger.debug("Ignoring error while trying to get user from config")
52+
logger.debug(ex)
53+
true
54+
case Right(valueOpt) =>
55+
valueOpt.isDefined
56+
})
5857

5958
def defaultValue(pubOpt: BPublishOptions): Either[BuildException, OptionCheck.DefaultValue] =
6059
either {

modules/cli/src/test/scala/cli/tests/HelpCheck.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ class HelpCheck extends munit.FunSuite {
1515
assert(lines <= 80)
1616
}
1717

18-
test("version help message should only contain relevant options") { // regression test - https://github.com/VirtusLab/scala-cli/issues/1666
18+
test(
19+
"version help message should only contain relevant options"
20+
) { // regression test - https://github.com/VirtusLab/scala-cli/issues/1666
1921
val helpMessage = Version.finalHelp.help(Version.helpFormat)
2022

2123
expect(helpMessage.contains("Version options:"))

modules/core/src/main/scala/scala/build/Position.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ object Position {
115115
File(path, startPos, endPos)
116116
}
117117
}
118-
final case class CommandLine(arg: String = "") extends Position { // todo the exact arg should be somehow taken from CaseApp
118+
final case class CommandLine(arg: String =
119+
"") extends Position { // todo the exact arg should be somehow taken from CaseApp
119120
def render(cwd: os.Path, sep: String): String = "COMMAND_LINE"
120121
}
121122

modules/directives/src/main/scala/scala/build/preprocessing/directives/ScalaJs.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ final case class ScalaJs(
112112
case Some(importmap) =>
113113
BuildOptions(
114114
scalaJsOptions = scalaJsOptions.copy(remapEsModuleImportMap = Some(importmap))
115-
)
116-
)
115+
))
117116
}
118117

119118
class ImportMapNotFound(message: String, cause: Throwable)

modules/integration/src/test/scala/scala/cli/integration/PackageTestDefinitions.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,16 @@ abstract class PackageTestDefinitions extends ScalaCliSuite with TestScalaVersio
869869
test("source JAR") {
870870
val dest = os.rel / "sources.jar"
871871
simpleInputWithScalaAndSc.fromRoot { root =>
872-
os.proc(TestUtil.cli, "--power", "package", extraOptions, ".", "-o", dest, "--with-sources").call(
872+
os.proc(
873+
TestUtil.cli,
874+
"--power",
875+
"package",
876+
extraOptions,
877+
".",
878+
"-o",
879+
dest,
880+
"--with-sources"
881+
).call(
873882
cwd = root,
874883
stdin = os.Inherit,
875884
stdout = os.Inherit

modules/integration/src/test/scala/scala/cli/integration/RunTestsDefault.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,12 @@ class RunTestsDefault extends RunTestDefinitions
102102
"""//> using dep tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar
103103
|import tabby.Grid
104104
|@main def main = println(Grid("a", "b", "c")(1, 2, 3))
105-
|""".stripMargin).fromRoot { root =>
106-
val res = os.proc(TestUtil.cli, "run", extraOptions, inputPath)
107-
.call(cwd = root)
108-
val out = res.out.trim()
109-
expect(out.contains("a, b, c"))
105+
|""".stripMargin).fromRoot {
106+
root =>
107+
val res = os.proc(TestUtil.cli, "run", extraOptions, inputPath)
108+
.call(cwd = root)
109+
val out = res.out.trim()
110+
expect(out.contains("a, b, c"))
110111
}
111112
}
112113

modules/integration/src/test/scala/scala/cli/integration/SipScalaTests.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,9 @@ class SipScalaTests extends ScalaCliSuite
262262
}
263263

264264
if (TestUtil.isNativeCli)
265-
test(s"usage instruction should point to scala when installing by cs") { // https://github.com/VirtusLab/scala-cli/issues/1662
265+
test(
266+
s"usage instruction should point to scala when installing by cs"
267+
) { // https://github.com/VirtusLab/scala-cli/issues/1662
266268
TestInputs.empty.fromRoot {
267269
root => // cs installs binaries under .app-name.aux and scala-cli should drop .aux from progName
268270
val binary = "scala".prepareBinary(root)

project/deps.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ object Deps {
210210
def scala3Compiler(sv: String) = ivy"org.scala-lang:scala3-compiler_3:$sv"
211211
def scalaAsync = ivy"org.scala-lang.modules::scala-async:1.0.1".exclude("*" -> "*")
212212
def scalac(sv: String) = ivy"org.scala-lang:scala-compiler:$sv"
213-
def scalafmtCli = ivy"org.scalameta:scalafmt-cli_2.13:3.8.3"
213+
def scalafmtCli = ivy"org.scalameta:scalafmt-cli_2.13:3.8.5"
214214
// Force using of 2.13 - is there a better way?
215215
def scalaJsEnvJsdomNodejs =
216216
ivy"org.scala-js:scalajs-env-jsdom-nodejs_2.13:1.1.0"

website/docs/reference/cli-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ Pass a global dialect for scalafmt. This overrides whatever value is configured
501501

502502
Aliases: `--fmt-version`
503503

504-
Pass scalafmt version before running it (3.8.3 by default). If passed, this overrides whatever value is configured in the .scalafmt.conf file.
504+
Pass scalafmt version before running it (3.8.5 by default). If passed, this overrides whatever value is configured in the .scalafmt.conf file.
505505

506506
## Global suppress warning options
507507

website/docs/reference/scala-command/cli-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ Aliases: `--fmt-version`
370370

371371
`IMPLEMENTATION specific` per Scala Runner specification
372372

373-
Pass scalafmt version before running it (3.8.3 by default). If passed, this overrides whatever value is configured in the .scalafmt.conf file.
373+
Pass scalafmt version before running it (3.8.5 by default). If passed, this overrides whatever value is configured in the .scalafmt.conf file.
374374

375375
## Global suppress warning options
376376

website/docs/reference/scala-command/runner-specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3924,7 +3924,7 @@ Aliases: `--dialect`
39243924

39253925
**--scalafmt-version**
39263926

3927-
Pass scalafmt version before running it (3.8.3 by default). If passed, this overrides whatever value is configured in the .scalafmt.conf file.
3927+
Pass scalafmt version before running it (3.8.5 by default). If passed, this overrides whatever value is configured in the .scalafmt.conf file.
39283928

39293929
Aliases: `--fmt-version`
39303930

0 commit comments

Comments
 (0)