Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent Intellij from treating Scala warning as error?

I'm trying out Intellij on a mixed Java/Scala project. Build is failing with errors like this:

Error: scala: /home/kevin/ij/backend/srctest/com/example/package/DoStuffTest.java:35: warning: [deprecation] OldStuffList in com.example.package has been deprecated

I'm not able to find any setting related to treating warning as errors. I'd like these to be reported as warnings (because indeed, they are warnings), but not prevent the build from completing.

like image 990
Kevin Peterson Avatar asked Feb 21 '13 21:02

Kevin Peterson


People also ask

Does IntelliJ work with Scala?

To start working with Scala in IntelliJ IDEA you need to download and enable the Scala plugin. If you run IntelliJ IDEA for the first time, you can install the Scala plugin when IntelliJ IDEA suggests downloading featured plugins. Otherwise, you can use the Settings | Plugins page for the installation.


2 Answers

In the scala compiler settings, check that there is no -Xfatal-warnings This option makes scalac treat warning as error.

Note that I had this problem after a colleague added this option in the build.sbt of an sbt project. Intellij then added it to its scala compiler settings.

like image 177
Juh_ Avatar answered Oct 31 '22 20:10

Juh_


If you hit alt-enter on the highlighted error, it should at least give you a dropdown option called "Disable inspection" which should let you turn that off for that instance or all Deprecated errors. This doesn't really solve your problem, but it might at least get you past it.

like image 34
Ian McMahon Avatar answered Oct 31 '22 19:10

Ian McMahon