Skip to content

Update scalafmt-core to 3.9.0 #846

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

Merged
merged 3 commits into from
Feb 17, 2025
Merged
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.4
7fd0641d92a10f1cc0d027860aa8c07caada0cdc

# Scala Steward: Reformat with scalafmt 3.9.0
f597745711467c5e0f4e382086a5bbb7badd1354
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.6"
version = "3.9.0"
project.git = true
align.preset = none
align.stripMargin = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
|
|object Rewrites {
| private class Patch(var span: Span)
|
|
| def main(args: Array[String]): Unit = {
| val patch = new Patch(new Span(0))
| println("ok")
Expand Down Expand Up @@ -1987,7 +1987,7 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
|
|object Main {
| private class B extends A
|
|
| def main(args: Array[String]): Unit = {
| val b = new B
| println("foo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ScalaStackTraceTests extends DebugTestSuite {
|}
|
|def m2(t : Int ) : Int = {
| t*2
| t*2
|}
|
|object Main {
Expand Down Expand Up @@ -136,13 +136,13 @@ class ScalaStackTraceTests extends DebugTestSuite {
val source =
"""|package example
|object Main :
| def main(args: Array[String]): Unit =
| def main(args: Array[String]): Unit =
| class B :
| def m() = {
| println("hello")
| }
|
| class C extends B
| class C extends B
| C().m()
|""".stripMargin
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", scalaVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Scala213SourceBreakpointTests extends SourceBreakpointTests(ScalaVersion.`
"""|package example
|object Main {
| def main(args: Array[String]): Unit = {
| List(new java.lang.Integer(1), new java.lang.Integer(2), new java.lang.Integer(3)).map { i =>
| List(new java.lang.Integer(1), new java.lang.Integer(2), new java.lang.Integer(3)).map { i =>
| val msg = i + 2
| println(msg)
| }
Expand All @@ -31,7 +31,7 @@ class Scala31PlusSourceBreakpointTests extends SourceBreakpointTests(ScalaVersio
"""|package example
|object Main {
| def main(args: Array[String]): Unit = {
| List(new java.lang.Integer(1), new java.lang.Integer(2), new java.lang.Integer(3)).map { i =>
| List(new java.lang.Integer(1), new java.lang.Integer(2), new java.lang.Integer(3)).map { i =>
| val msg = i + 2
| println(msg)
| println(s"$msg bis")
Expand Down Expand Up @@ -69,7 +69,7 @@ abstract class SourceBreakpointTests(val scalaVersion: ScalaVersion) extends Deb
"""|package example
|object Main {
| def main(args: Array[String]): Unit = {
| List(1, 2, 3).map { i =>
| List(1, 2, 3).map { i =>
| val msg = i.toString
| println(msg)
| }
Expand All @@ -86,7 +86,7 @@ abstract class SourceBreakpointTests(val scalaVersion: ScalaVersion) extends Deb
"""|package example
|object Main {
| def main(args: Array[String]): Unit = {
| val list = List(1, 2, 3).map { i =>
| val list = List(1, 2, 3).map { i =>
| val msg = i.toString
| msg
| }
Expand Down Expand Up @@ -115,7 +115,7 @@ abstract class SourceBreakpointTests(val scalaVersion: ScalaVersion) extends Deb
|object Main {
| def main(args: Array[String]): Unit = {
| val i: Int = 3
|
|
| print(i)
| ()
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
| def m1(xs: String*) = println(xs.mkString)
| def m2(xs: Int*) = println(xs.mkString)
| def m3(xs: Unit*) = println(xs.mkString)
|
|
| def main(args: Array[String]): Unit = {
| m1("a", "b")
| m2(1, 2)
Expand Down Expand Up @@ -313,11 +313,11 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
|object Main {
| var x1 = "x1"
| private var x2 = "x2"
|
|
| def main(args: Array[String]): Unit = {
| x1 = "x1"
| x2 = "x2"
|
|
| val c = new C("c1", "c2")
| c.m()
| }
Expand All @@ -335,7 +335,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
|class C(var c1: String, private var c2: String) extends B with A {
| /* override */ var a1: String = "a1"
| private var c3: String = "c3"
|
|
| def m(): Unit = {
| a1 = "a1"
| b1 = "b1"
Expand Down Expand Up @@ -509,7 +509,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
| def main(args: Array[String]): Unit = {
| val a = new A("a")
| val b = new A("b")
|
|
| a.toString
| a.copy("b")
| a.hashCode()
Expand All @@ -518,7 +518,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
| a.productPrefix
| a.productElement(0)
| a.productIterator
|
|
| val f = A
| f("a")
|
Expand Down Expand Up @@ -733,7 +733,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
|
|object Main {
| def m(x: "a"): 1 = 1
|
|
| def main(args: Array[String]): Unit = {
| m("a")
| }
Expand All @@ -755,7 +755,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
| type Foo = A
| type Bar = String
| def m(x: Foo): Bar = x.toString
|
|
| def main(args: Array[String]): Unit = {
| val foo = new A
| m(foo)
Expand All @@ -777,11 +777,11 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
| def m1(): A with B { def foo: String } = {
| new A with B { def foo: String = toString }
| }
|
|
| def m2(): { def foo: String } = {
| new { def foo: String = toString }
| }
|
|
| def main(args: Array[String]): Unit = {
| m1()
| m2()
Expand All @@ -800,9 +800,9 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
|
|trait B {
| type X <: A
|
|
| def m1(x: X): X = x
| def m2[T <: X](x: T) = x
| def m2[T <: X](x: T) = x
|}
|
|class C extends B {
Expand Down Expand Up @@ -1051,7 +1051,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
| x.m
| &(x)
| }
|
|
| def &(x: <>): String = x.toString
|}
|
Expand Down Expand Up @@ -1079,7 +1079,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
| def main(xs: Array[String]): Unit = {
| fac(2)
| }
|
|
| def fac(x: Int): Int = {
| def rec(x: Int, acc: Int): Int = {
| if (x <= 0) acc
Expand Down Expand Up @@ -1259,7 +1259,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
| def m1(xs: String*) = println(xs.mkString)
| def m2(xs: Int*) = println(xs.mkString)
| def m3(xs: Unit*) = println(xs.mkString)
|
|
| def main(args: Array[String]): Unit = {
| m1("a", "b")
| m2(1, 2)
Expand Down Expand Up @@ -1324,7 +1324,7 @@ abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends
|case class B(a: A):
| export a.*
|
|@main def Main =
|@main def Main =
| val b = B(A())
| b.aa
|""".stripMargin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ class JavaRuntimeEvaluatorTests extends DebugTestSuite {
| public Foo() {
| this.friendFoo = new FriendFoo(this);
| }
|
|
| public FriendFoo friendFoo(Foo f) { return new FriendFoo(f); }
| class FriendFoo {
| public Foo f;
| public int y = 42;
| public static final int z = 43;
| public static final String greet = "Friendly";
|
|
| public FriendFoo(Foo f) { this.f = f; }
| public String greet() { return "Friend"; }
| public int add(int x, int y) { return x + y; }
Expand Down Expand Up @@ -121,7 +121,7 @@ class JavaRuntimeEvaluatorTests extends DebugTestSuite {
| }
|}
|
|class SuperFoo {
|class SuperFoo {
| private String superfoo = "hello super";
| public static String foofoo = "superfoofoo";
|}
Expand Down Expand Up @@ -175,7 +175,7 @@ class JavaRuntimeEvaluatorTests extends DebugTestSuite {
| public static String staticMethod() { return "i am static"; }
|}
|
|class SuperFoo {
|class SuperFoo {
| public static String staticMethod() { return "i am static superfoo"; }
|}
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class MetalsClassBreakpointSuite extends FunSuite {
check(
"""|package a
|
|@main
|@main
|def helloWorld(): Unit = {
| object Even {
|>> def unapply(s: String): Boolean = s.size % 2 == 0
Expand All @@ -146,13 +146,13 @@ class MetalsClassBreakpointSuite extends FunSuite {
check(
"""|package a
|
|@main
|def hello(): Unit =
|@main
|def hello(): Unit =
| greet("Alice")
| greet("Bob")
| System.exit(0)
|
|def greet(name: String) =
|def greet(name: String) =
| val message = s"Hello, $name!"
|>>println(message)
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object RuntimeEvaluatorEnvironments {
|
|trait FooTrait { val foo1: String = "hello there" }
|
|class SuperFoo {
|class SuperFoo {
| private val superfoo: String = "hello super"
| def keepSuperfoo: String = superfoo
|}
Expand Down Expand Up @@ -80,8 +80,8 @@ object RuntimeEvaluatorEnvironments {
| object InnerFoo { def hello: String = "hello main inner foo" }
|}
|
|trait FooTrait {
| val x = 3
|trait FooTrait {
| val x = 3
| def bar1: Int = 42
|}
|
Expand Down Expand Up @@ -130,7 +130,7 @@ object RuntimeEvaluatorEnvironments {
| val subCool = new SubCool()
| println("ok")
| }
|
|
| def test(foo: Foo): String = "foo"
| def test(bar: Bar): String = "bar"
| def test(baz: Baz): String = "baz"
Expand Down Expand Up @@ -171,11 +171,11 @@ object RuntimeEvaluatorEnvironments {
| case class Inner(x: Int) {
| val y = x + 1
| def helloInner = s"hello inner $x"
| case class InnerInner() {
| case class InnerInner() {
| val str = {
| println("ok")
| s"inner inner $y"
| }
| }
| }
| object InnerInner {
| val str = {
Expand All @@ -184,7 +184,7 @@ object RuntimeEvaluatorEnvironments {
| }
| }
| }
| object Inner {
| object Inner {
| val z = 42
| def helloInner = "hello inner"
| case class DoubleInner(zz: Int) { val str = s"double inner $zz"}
Expand Down Expand Up @@ -237,7 +237,7 @@ object RuntimeEvaluatorEnvironments {
| def main(args: Array[String]): Unit = {
| println("ok")
| }
|
|
| def test(i: Int): String = "primitive int"
| def test(i: java.lang.Integer): String = "boxed int"
|}
Expand All @@ -254,7 +254,7 @@ object RuntimeEvaluatorEnvironments {
| val seq = Seq(1, 2, 3)
| val vector = Vector(1, 2, 3)
| println("ok")
| }
| }
|}
|""".stripMargin

Expand Down Expand Up @@ -1038,7 +1038,7 @@ abstract class ScalaRuntimeEvaluatorTests(val scalaVersion: ScalaVersion) extend
|
|object Main {
| var b = 0
| var c = 0
| var c = 0
| def main(args: Array[String]): Unit = {
| val a = new A
| var b = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ abstract class RuntimePreEvaluationTests(val scalaVersion: ScalaVersion) extends
| case object Baz extends InnerFoo {
| val baz: Int = 2
| }
|
|
| val innerBar: InnerFoo = Bar
| val innerBaz: InnerFoo = Baz
|}
Expand Down
Loading