-
Notifications
You must be signed in to change notification settings - Fork 161
Auto-format imports #518
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
Auto-format imports #518
Conversation
run: sbt "++${{ matrix.scalaversion }}" package | ||
run: sbt -DCI=1 "++${{ matrix.scalaversion }}" package |
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.
What does DCI=1
do?
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.
Facilitates this:
Lines 31 to 41 in b0fa8f9
val inCI = Option(System.getenv("CI")).exists(_.contains("1")) | |
val commonSettings = Seq( | |
organization := "org.scala-js", | |
scalacOptions ++= Seq( | |
"-deprecation", | |
"-feature", | |
), | |
scalacOptions ++= (if (!inCI) Seq.empty else Seq( | |
"-Xfatal-warnings", | |
)), |
So -Xfatal-warnings
isn't enabled locally, we need actual warnings so that scalafix can identify and remove unnecessary imports. Where as in CI, we expect that scalafix has already been run (as part of prePR
) so we turn those warnings back into errors.
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.
Wait a minute, doesn't -D
set system properties and not environment variables?
Oh I see you already approved, cool, merging |
@japgolly Oops, maybe I should have revoked my approval until you clarified #518 (comment) 😅 |
faaaaaaaaaaaark, good catch |
This is part of #479. I'd love to do all of #479 on the 1.x branch but it would probably just make it harder to merge the outstanding PRs. Doing just the import side now though shouldn't be very disruptive and it lays a little more groundwork.