Skip to content
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

scalafixEnable: relax -Xfatal-warnings for scalafix invocations #195

Merged
merged 2 commits into from
Mar 4, 2021

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Mar 3, 2021

Closes scalacenter/scalafix#1346

scalafixEnable should maximize the chances of getting semanticdb-scalac to run so that semantic rules can run.

When enabled in the build, -Xfatal-warnings can be a major obstacle for example when:

  1. scalafixEnable forced a newer (patch) Scala version that the one in the build, with improved warning reporting;
  2. the user already has a build with fatal deprecation warnings and wants to apply a rewrite rule to fix them.

scalafixEnable should maximize the chances of getting semanticdb-scalac
to run so that semantic rules can run.

When enabled in the build, -Xfatal-warnings can be a major obstacle
for example when:
1. scalafixEnable forced a newer (patch) Scala version that the one in
   the build, with improved warning reporting;
2. the user already has a build with fatal deprecation warnings and
   wants to apply a rewrite rule to fix them.
Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great idea!

}

private def scalafixInvoked: Def.Initialize[Task[Boolean]] =
Def.task(executionRoots.value.exists(_.key == scalafix.key))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also check for scalafixAll?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! just added 9c91d70

@bjaglin bjaglin merged commit 1eeafe2 into scalacenter:master Mar 4, 2021
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.

Remove -Xfatal-warnings scalac option in scalafixEnable
4 participants