-
Notifications
You must be signed in to change notification settings - Fork 276
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
scalafmt rewrites scala 2 syntax into scala 3 in build.sbt file #3787
Comments
* Port to Scala 3 * Refactor reference package object * Convert package objects to toplevel * Set Scala 3 rewrite rules * Run scalafmt * Update copyright * Set version to 3.12.0-SNAPSHOT * Update changelog * Update GH actions * Workaround for scalafmt issue See scalameta/scalafmt#3787
This fix doesn't work for files in the |
can you please be more specific? which files? |
This is a minimal repo: https://github.com/mzuehlke/scalafmt-sbt-project-bug Invoking diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 749733c..911726f 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -1,5 +1,4 @@
import sbt.*
-object Dependencies {
+object Dependencies:
val cats = "org.typelevel" %% "cats-core" % "2.10.0"
-} |
@mzuehlke i think you have unrealistic expectations. this is not an sbt file, it's a scala file. if you specify in your configuration that your dialect is scala3, at least for scala files that's what it will be. |
Thanks for the clarification. If this is the expected behaviour that's fine. 👍 Maybe an addition to the config would be helpful so that everyone who adds scala3 specific options know that a |
Configuration (required)
See https://github.com/mtomko/scalafmt-repro2
Please paste the contents of your
.scalafmt.conf
file here:Command-line parameters (required)
When I run scalafmt via CLI like this:
scalafmt
Steps
Given code like this:
Problem
Scalafmt formats code like this:
Expectation
I would like the formatted output to look like this:
Notes
Briefly discussed on discord: https://discord.com/channels/632642981228314653/632665341864181780/1209538770303721533
The text was updated successfully, but these errors were encountered: