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

chore: Scalafmt upgrade #32187

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

leviramsey
Copy link
Contributor

Draft for now (the formatting changes that result are omitted).

Some of the previous scalafmt settings have no direct equivalent in modern scalafmt, so the diff will be something to behold. Leaving out the resulting formatting changes to facilitate local playing around with the settings.

+~ 3.3 Test/compile

passes.

References #32186 and #32083.

@@ -35,8 +35,11 @@ final case class SerializationCheckFailedException private[dungeon] (msg: Object
@InternalApi
private[akka] trait Dispatch { this: ActorCell =>

// scalafmt breaks this by moving the _ to its own line which doesn't compile
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interaction of breaking long lines in scalafmt with the semicolon inference in at least Scala 3.3.1

Copy link
Member

@patriknw patriknw left a comment

Choose a reason for hiding this comment

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

I looked at some (random) formatting changes. Overall looks pretty good.

Noted a few annoying things

/** INTERNAL API */

will be broken up in 3 lines

        props.args.forall(
          arg =>

it was more compact

props.args.forall(arg =>

extra ( ) around function parameter

(ex) => shouldRetry.test(ex),

@patriknw
Copy link
Member

if we approve this change we should apply it to release-2.8 branch to make it easier to backport fixes

@leviramsey
Copy link
Contributor Author

I believe the extra ( ) around function parameters is a Scala 3 requirement (at least I've regularly had to clean up my code with parens around single arguments to get Scala 3 happy)

@patriknw
Copy link
Member

Scala 3 requirement

but it compiles fine without

@leviramsey
Copy link
Contributor Author

Scala 3 requires parens around single arguments with type ascriptions. Perhaps scalafmt also imposes the parens for its Scala 3-compatible modes?

@leviramsey leviramsey changed the title Scalafmt upgrade chore: Scalafmt upgrade Oct 29, 2023
@leviramsey
Copy link
Contributor Author

As noticed in another repo, docstrings.wrap = yes (the default) will do weird things with @param etc. in scaladoc, so incorporating that here.

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.

None yet

2 participants