Skip to content

Commit

Permalink
Add more variants in tests for binPack.defnSite
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed May 6, 2024
1 parent ab4d23c commit 279de7a
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 1 deletion.
112 changes: 111 additions & 1 deletion scalafmt-tests/src/test/resources/newlines/source_classic.stat
Expand Up @@ -3061,9 +3061,27 @@ object a {
audienceSizeOffsite = Some(1)
)
}
<<< binPack indent expiresOn=Before when dangle
<<< binPack indent expiresOn=Before when dangle, configStyleArguments
binPack.preset = true
optIn.configStyleArguments = true
danglingParentheses.defnSite = true
===
object a {
protected def foo[U](bar: String, baz: Seq[String] = Seq.empty)(
f: HttpResponse => U
): U = qux
}
>>>
object a {
protected def foo[U](bar: String,
baz: Seq[String] = Seq.empty)(
f: HttpResponse => U
): U = qux
}
<<< binPack indent expiresOn=Before when dangle, !configStyleArguments
binPack.preset = true
optIn.configStyleArguments = false
danglingParentheses.defnSite = true
===
object a {
protected def foo[U](bar: String, baz: Seq[String] = Seq.empty)(
Expand All @@ -3077,6 +3095,39 @@ object a {
baz: Seq[String] = Seq.empty
)(f: HttpResponse => U): U = qux
}
<<< binPack indent expiresOn=Before when !dangle, configStyleArguments
binPack.preset = true
optIn.configStyleArguments = true
danglingParentheses.defnSite = false
===
object a {
protected def foo[U](bar: String, baz: Seq[String] = Seq.empty)(
f: HttpResponse => U
): U = qux
}
>>>
object a {
protected def foo[U](bar: String,
baz: Seq[String] = Seq.empty)(
f: HttpResponse => U
): U = qux
}
<<< binPack indent expiresOn=Before when !dangle, !configStyleArguments
binPack.preset = true
optIn.configStyleArguments = false
danglingParentheses.defnSite = false
===
object a {
protected def foo[U](bar: String, baz: Seq[String] = Seq.empty)(
f: HttpResponse => U
): U = qux
}
>>>
object a {
protected def foo[U](bar: String,
baz: Seq[String] = Seq.empty)(
f: HttpResponse => U): U = qux
}
<<< #1973 1
maxColumn = 25
indent.extendSite = 2
Expand Down Expand Up @@ -7616,6 +7667,14 @@ object Main {
x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(
x1: X,
x2: X, xs: X*): Set[Int]
def foo1(x1: X,
x2: X, xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand All @@ -7629,6 +7688,12 @@ object Main {
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand Down Expand Up @@ -7693,6 +7758,14 @@ object Main {
x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(
x1: X,
x2: X, xs: X*): Set[Int]
def foo1(x1: X,
x2: X, xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand All @@ -7703,6 +7776,15 @@ object Main {
}
>>>
object Main {
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
Expand Down Expand Up @@ -7779,6 +7861,14 @@ object Main {
x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(
x1: X,
x2: X, xs: X*): Set[Int]
def foo1(x1: X,
x2: X, xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand All @@ -7792,6 +7882,12 @@ object Main {
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand Down Expand Up @@ -7850,6 +7946,14 @@ object Main {
x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(
x1: X,
x2: X, xs: X*): Set[Int]
def foo1(x1: X,
x2: X, xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand All @@ -7860,6 +7964,12 @@ object Main {
}
>>>
object Main {
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo2(x1: X, x2: X,
Expand Down
62 changes: 62 additions & 0 deletions scalafmt-tests/src/test/resources/newlines/source_fold.stat
Expand Up @@ -7194,6 +7194,14 @@ object Main {
x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(
x1: X,
x2: X, xs: X*): Set[Int]
def foo1(x1: X,
x2: X, xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand All @@ -7204,6 +7212,15 @@ object Main {
}
>>>
object Main {
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
Expand Down Expand Up @@ -7268,6 +7285,14 @@ object Main {
x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(
x1: X,
x2: X, xs: X*): Set[Int]
def foo1(x1: X,
x2: X, xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand All @@ -7278,6 +7303,15 @@ object Main {
}
>>>
object Main {
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
def foo1(
x1: X, x2: X, xs: X*
): Set[Int]
Expand Down Expand Up @@ -7351,6 +7385,14 @@ object Main {
x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(
x1: X,
x2: X, xs: X*): Set[Int]
def foo1(x1: X,
x2: X, xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand All @@ -7361,6 +7403,12 @@ object Main {
}
>>>
object Main {
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo2(x1: X, x2: X,
Expand Down Expand Up @@ -7421,6 +7469,14 @@ object Main {
x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(x1: X,
x2: X, xs: X*
): Set[Int]
def foo1(
x1: X,
x2: X, xs: X*): Set[Int]
def foo1(x1: X,
x2: X, xs: X*): Set[Int]
def foo2(
x1: X, x2: X, x3: X,
x4: X, xs: X*
Expand All @@ -7431,6 +7487,12 @@ object Main {
}
>>>
object Main {
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo1(x1: X, x2: X,
xs: X*): Set[Int]
def foo2(x1: X, x2: X,
Expand Down

0 comments on commit 279de7a

Please sign in to comment.