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

fix UnusedScalafixSuppression warnings on Scala 3 scalafix invocations #1979

Merged
merged 1 commit into from
May 1, 2024

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Apr 21, 2024

No description provided.

throw new UnsupportedOperationException(
"No longer supported."
) // scalafix:ok
override def syntax: String =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bjaglin bjaglin marked this pull request as ready for review May 1, 2024 11:14
@bjaglin bjaglin changed the title remove unused scalafix silencer fix UnusedScalafixSuppression warnings on Scala 3 scalafix executions May 1, 2024
Since ExplicitResultTypes is unavailable in Scala 3, some silencers are
rightfully detected as unused for that invocation. Qualifying these silencers
by suffixing ExplicitResultTypes does not help, since EscapeHatch is not aware
of which rules are executed, so we need to address the problem differently.

- For the (v0) signature, this removes the silencer to be explicit about the
  type since there is no reason (except compatibility) to keep it this way.
  Since this is the old API and a very specific class, it's unlikely that will
  will cause linking errors when running community rules with existing
  versions.
- For test suites where we DO want an explicit type, this turns private the
  terms that ExplicitResultTypes warns on to stop triggering it. However, this
  triggers RemoveUnused, but since it is now common to both Scala 2 and Scala 3
  and, it does not trigger UnusedScalafixSuppression in any invocation.
@bjaglin bjaglin changed the title fix UnusedScalafixSuppression warnings on Scala 3 scalafix executions fix UnusedScalafixSuppression warnings on Scala 3 scalafix invocations May 1, 2024
@bjaglin bjaglin merged commit b5230fd into scalacenter:main May 1, 2024
9 checks passed
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.

None yet

1 participant