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

Metals 1.4 fails compilation with Wartremover installed #6889

Open
andyczerwonka opened this issue Oct 25, 2024 · 4 comments
Open

Metals 1.4 fails compilation with Wartremover installed #6889

andyczerwonka opened this issue Oct 25, 2024 · 4 comments

Comments

@andyczerwonka
Copy link
Contributor

andyczerwonka commented Oct 25, 2024

Compiler quits with Wartremover Enabled

During today's upgrade from 1.3.5 to 1.4.0, I noticed that compilation of our projects just stopped compiling after a couple of projects. After looking at the bloop errors, I decided to remove WartRemover from our environment to see if that was cousing the issue. Once removed, Metals started working again.

I removed the following:

addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.2.3")
ThisBuild / wartremoverErrors ++= Seq(
  Wart.ArrayEquals,
  Wart.Recursion
)

ThisBuild / wartremoverExcluded += baseDirectory.value / "code" / "orion" / "ml-config-core" / "src" / "main" / "scala" / "db"

I've included the errors we were seeing.
reports.zip

Here are another set of errors after removing wartremover, but Metals does seem to work.

reports_removed_wartremover.zip

Expected behavior

I expect Metals to be tolerant of Wartremover, and continue to compile all of the code.

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

v1.4.0

Extra context or search terms

wartremover

@andyczerwonka
Copy link
Contributor Author

It looks to be the same problem as scalacenter/bloop#1421 and is a blocker for upgrading for us. We'll revert to 1.3.5 until such time that we have a solution.

@andyczerwonka
Copy link
Contributor Author

Also looks like there's a solution coming. scalacenter/bloop#2485

@agilesteel
Copy link

We ran into the same issue. There is an even smaller reproduction (hello world essentially) that I reported on discord. I'll paste it here. Maybe someone will find it useful:

build.sbt

scalaVersion := "2.13.15"
wartremoverWarnings := Warts.all

project/plugins.sbt

addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.2.3")

src/main/scala/Main.scala

object Main extends App

@tgodzik
Copy link
Contributor

tgodzik commented Oct 25, 2024

Thanks! I think I already have a fix. As soon as it's merged I will release bloop, then probably metals also

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

No branches or pull requests

3 participants