-
Notifications
You must be signed in to change notification settings - Fork 90
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
Format scala-3 MacroCompat with scala3 runner #518
Conversation
.scalafmt.conf
Outdated
project.excludeFilters = [ | ||
".*scala-3*" | ||
"LinesSuite.scala" | ||
".*scala-3.*MacroCompat.scala$" | ||
] | ||
runner.dialect = scala212 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exclude, vs fileOverride
?
fileOverride {
"glob:**/src/{main,test}/scala-3/**" {
runner.dialect = scala3
}
}
https://github.com/typelevel/cats/blob/9732f90a4891346fe7979918e606be32b01eef26/.scalafmt.conf#L15
I changed the .scalafmt.conf to use the suggested:
Unfortunately, I ran into a weird issue where scalafmt, with dialect Prior to this PR we have the following line in implicit def generate[T](value: T): Clue[T] = macro MacroCompatScala2.clueImpl scalafmt, with dialect implicit def generate[T](value: T): Clue[T] =
macro MacroCompatScala2.clueImpl Which scalafmt then fails to parse:
|
Maybe just disable scalafmt on that line? |
Opened an issue upstream for now scalameta/scalameta#2727 |
Co-authored-by: Arman Bilge <armanbilge@gmail.com>
This was originally in #225 which I am trying to minimize by plucking things out of it.
This PR updates scalafmt to the latest "3.5.4", and formats the scala-3 MacroCompat files which were previously excluded.
Additionally, this formats
munit/shared/src/main/scala-2/munit/internal/MacroCompat.scala
as the previous regex actually matches onscala-