Skip to content
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

Router: Align binpack.{call,defn}Site behaviour #3977

Merged
merged 1 commit into from
May 13, 2024

Conversation

kitbellew
Copy link
Collaborator

@kitbellew kitbellew commented May 11, 2024

Also, modify it so that it matches configuration parameters better. In most cases, it will either preserve formatting (which tests may not show as they operate on non-formatted code) or can easily be configured to match existing formatting.

This change partially restores some of formatting changes introduced in recent commits, by making their results more consistent with new logic.

Fixes #3954.

@@ -1714,13 +1714,13 @@ object a {
}
>>>
object a {
val cls =
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is restored to pre-#3980 state.

@@ -5070,8 +5077,7 @@ object a {
>>>
object a {
def foo(bb: BB, cc: CC, dd: DD = DDD.ddd): Bar[
Baz
] = {
Baz] = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is restored to pre-#3980 state.

@@ -773,8 +767,7 @@ optDef.getOrElse {
abort(
fooFoo &&
barBar,
bazBaz
)
bazBaz)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change and all above it are restored to pre-#3980 state.

@@ -43,8 +43,8 @@ class Promise[+A](
executor: js.Function2[js.Function1[A | Thenable[A], _], js.Function1[scala.Any, _], _])
>>>
class Promise[+A](
executor: js.Function2[js.Function1[A | Thenable[A],
_], js.Function1[scala.Any, _], _])
executor: js.Function2[js.Function1[A | Thenable[A], _], js.Function1[
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is restored to pre-#3980 state.

js.Array[JSStackTraceElem],
js.Array[JSStackTraceElem]
]] = js.native
js.Array[JSStackTraceElem], js.Array[JSStackTraceElem]]] = js.native
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is restored to pre-#3980 state.

@@ -358,10 +358,12 @@ import foo.{
a, b,
}
class foo(
a: String, b: String,
a: String,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and all other "trailing commas" changes are simply a fix: all have allowFolding = false hence must preserve dangling close paren which is enough to output config-style (since dangling parens are off by default in the tests)

@@ -1020,7 +1023,8 @@ object a {
object a {
private val foo = Seq(
// out of range
Bar("2018-01-02", 1,
Bar(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fold=true, cfg=true, dangle=false lead to dangling open and tucked close.

) = SalesUserActivity(user_id, dept_id, catg_grp_id, catg_id, subcatg_id, brand_id,
Some(dummyBrand), 1f, 1f, item_id, tenant, inid, catalog, channel,
order_date.split("-")(0).toInt, order_date.split("-")(1).toInt, "v1", order_date)
) = SalesUserActivity(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here and in the next change: fold=true, cfg=true, dangle=true lead to dangling open and close.

Also, modify it so that it matches configuration parameters better. In
most cases, it will either preserve formatting (which tests may not show
as they operate on non-formatted code) or can easily be configured to
match existing formatting.

This change partially restores some of formatting changes introduced in
recent commits, by making their results more consistent with new logic.
@kitbellew kitbellew merged commit d8d4842 into scalameta:master May 13, 2024
9 checks passed
@kitbellew kitbellew deleted the 3954 branch May 13, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean-up config-style and binpacking code
2 participants