/
Scala Warnings
Scala Warnings
Currently Scala 2.x is supported. Scala 3.x isn’t yet supported.
Tell us if you are using Scala 3, so we can prioritize supporting it.
Enable Scala compiler warnings in your build to see them in the pull requests.
In SBT
Enable the compiler flags for which you want to get warnings in the SBT build:
lazy val scalaExample = (project in file("."))
.settings(
name := "scala-sbt-example",
scalacOptions += "-unchecked",
scalacOptions += "-feature",
scalacOptions += "-deprecation",
scalacOptions += "-Ywarn-numeric-widen",
scalacOptions += "-Ywarn-value-discard",
scalacOptions += "-Ywarn-unused",
)
In Maven
Enable the compiler flags for which you want to get warnings in the Maven build:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
...
</executions>
<configuration>
<args>
<arg>-target:jvm-1.8</arg>
<arg>-encoding</arg>
<arg>utf8</arg>
<!-- Select the warnings you want to see from the Scala compiler -->
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-Ywarn-numeric-widen</arg>
<arg>-Ywarn-value-discard</arg>
<arg>-Ywarn-dead-code</arg>
<arg>-Ywarn-unused</arg>
</args>
</configuration>
</plugin>
, multiple selections available,
Related content
Checkstyle Analysis Results
Checkstyle Analysis Results
More like this
Migrating Static Analyzers
Migrating Static Analyzers
Read with this
Java Warnings
Java Warnings
More like this
(Deprecated, Bitbucket 7 Only) External static analyzers
(Deprecated, Bitbucket 7 Only) External static analyzers
Read with this
Release Notes v5.1
Release Notes v5.1
More like this
Troubleshooting
Troubleshooting
Read with this