Skip to content

Conversation

@dc-smith
Copy link

@dc-smith dc-smith commented Nov 17, 2025

This PR adds a rewrite flag to scalafmt to ensure we use the Scala 3 syntax going forward. This will avoid a moment in the future where the Scala 2 syntax (e.g. underscore wildcard imports) are removed, and ensure consistency in the style used across the codebase.

We already have this flag in place for the stubs, and it's being added to the frontend and backend as part of the inflight migration work.

There are more granular config options here if we want to retain the scala 2 syntax for any of the specific changes here.

@platops-pr-bot
Copy link

JamesMMiller
JamesMMiller previously approved these changes Nov 17, 2025
@JamesMMiller
Copy link
Contributor

seems to be failing on lint:
image

@dc-smith
Copy link
Author

seems to be failing on lint: image

Thanks, I thought I had got it by hand, I didn't realise you can use scalafmtSbt to do this automatically.

@JamesMMiller
Copy link
Contributor

seems to be failing on lint: image

Thanks, I thought I had got it by hand, I didn't realise you can use scalafmtSbt to do this automatically.

We have a command alias sbt lint that runs addCommandAlias("lint", ";scalafmtAll;scalafmtSbt;scalafixAll")

@dc-smith
Copy link
Author

Ah, now it's using the quiet syntax for the ifs in the project files, the project won't load since that's 2.12. Looking to see if there's a way around that now.

@dc-smith
Copy link
Author

Seems sbt is happy with asterisk and question mark wildcards, but not with the quiet control syntax. I've suppressed scalafmt in the two cases in the project files where it would have otherwise changed; it'll likely come up during the eventual sbt 2 migration. Then I added a dialect to scalafix, to avoid it moving the syntax back when sorting imports.

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.

4 participants