-
-
Notifications
You must be signed in to change notification settings - Fork 287
Use ::: as scalacopts delimiter #1053
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
Use ::: as scalacopts delimiter #1053
Conversation
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.
Thanks!
I’m not sure I understand how the current test guards us from regression.
I understand previously it would have broke rules_scala but I don’t see how the added test demonstrates the support of this attribute.
@ittaiz sorry just saw the message in the slack. Just added
Let me know if further adjustment is needed. Thanks! |
ok, I think the current test indeed guards us but IMHO in a mechanical white box way. I'd be happy to push a commit to this PR with the test if the above isn't clear. Btw, |
Thanks! Makes sense. My initial plan was to introduce an unused import in the code then use Let me see if I can somehow only test this with 2.12 via |
If you fail on an unused import then this needs to be an external shell integration test (otherwise the build won’t pass). If you hit a wall with my offer LMK and I’ll help. You can even push a half baked commit. Re integration tests- There is work in the bazel space to allow such integration tests to be part of the bazel build. |
import c.universe._ | ||
// c.settings are the values from scalac's -Xmacro-settings | ||
val s = c.settings.mkString(",") | ||
c.Expr(q"""${s}""") |
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.
here is the relevant part using scalac options
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.
Thanks!
I think we’re really close
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.
Looks great, thanks!
Will merge once green.
* initial * polish * lint * one more * remove integ test * add unit test * add tests that uses scalacopts * minor * comment * accumlative macro options * rm tests * more clear options
Description
As suggested in #1049, using
:::
as the delimiter instead of,
to separate scalac options, in order to avoid collision with,
.Motivation
Per scalac doc https://docs.scala-lang.org/overviews/compiler-options/index.html: there could be options like
-Ywarn-unused:WARNING1,WARNING2
For example before this change, if
the build would fail with