Skip to content

Commit

Permalink
Add test with curried params alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Jan 11, 2023
1 parent 1defb93 commit 1f537f5
Showing 1 changed file with 153 additions and 0 deletions.
153 changes: 153 additions & 0 deletions scalafmt-tests/src/test/resources/align/DefaultWithAlign.stat
Original file line number Diff line number Diff line change
Expand Up @@ -1876,3 +1876,156 @@ foo ++= Seq(
"test",
foo %%% bar % baz % "test"
)
<<< curry params after
align.tokens."+" = [{
code = ":",
owners = [{ regex = "Term\\.Param" }]
}]
===
object a {
def longDefNameThatCausesLinesToWrap1(x: Type0)(y: Type1)(implicit
a: Type2,
bb: Type3,
ccc: Type4,
dddd: Type5,
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(x: Type0)(y: Type1)(implicit
dddd: Type5,
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(x: Type0)(y: Type1)(implicit
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
}
>>>
object a {
def longDefNameThatCausesLinesToWrap1(x: Type0)(y: Type1)(implicit
a: Type2,
bb: Type3,
ccc: Type4,
dddd: Type5,
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(x: Type0)(y: Type1)(implicit
dddd: Type5,
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(x: Type0)(y: Type1)(implicit
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
}
<<< curry params before
align.tokens."+" = [{
code = ":",
owners = [{ regex = "Term\\.Param" }]
}]
===
object a {
def longDefNameThatCausesLinesToWrap1(
a: Type2,
bb: Type3,
ccc: Type4,
dddd: Type5,
eeeee: Type6
)(x: Type0)(y: Type1): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(
dddd: Type5,
eeeee: Type6
)(x: Type0)(y: Type1): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(
eeeee: Type6
)(x: Type0)(y: Type1): Future[Option[ReturnType]] = { ??? }
}
>>>
object a {
def longDefNameThatCausesLinesToWrap1(
a: Type2,
bb: Type3,
ccc: Type4,
dddd: Type5,
eeeee: Type6
)(x: Type0)(y: Type1): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(
dddd: Type5,
eeeee: Type6
)(x: Type0)(y: Type1): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(
eeeee: Type6
)(x: Type0)(y: Type1): Future[Option[ReturnType]] = { ??? }
}
<<< curry params before and after
align.tokens."+" = [{
code = ":",
owners = [{ regex = "Term\\.Param" }]
}]
===
object a {
def longDefNameThatCausesLinesToWrap1(
a: Type2,
bb: Type3,
ccc: Type4
)(x: Type0)(y: Type1)(
dddd: Type5,
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(
eeeee: Type6
)(x: Type0)(y: Type1)(
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
}
>>>
object a {
def longDefNameThatCausesLinesToWrap1(
a: Type2,
bb: Type3,
ccc: Type4
)(x: Type0)(y: Type1)(
dddd: Type5,
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(
eeeee: Type6
)(x: Type0)(y: Type1)(
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
}
<<< curry params before and after, multiline
align.multiline = true
align.tokens."+" = [{
code = ":",
owners = [{ regex = "Term\\.Param" }]
}]
===
object a {
def longDefNameThatCausesLinesToWrap1(
a: Type2,
bb: Type3,
ccc: Type4
)(x: Type0)(y: Type1)(
dddd: Type5,
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(
eeeee: Type6
)(x: Type0)(y: Type1)(
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
}
>>>
object a {
def longDefNameThatCausesLinesToWrap1(
a: Type2,
bb: Type3,
ccc: Type4
)(x: Type0)(y: Type1)(
dddd: Type5,
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
def longDefNameThatCausesLinesToWrap1(
eeeee: Type6
)(x: Type0)(y: Type1)(
eeeee: Type6
): Future[Option[ReturnType]] = { ??? }
}

0 comments on commit 1f537f5

Please sign in to comment.