-
Notifications
You must be signed in to change notification settings - Fork 21
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
Can't use -Xfatal-warnings when anything is deprecated #8410
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8410?orig=1 |
@retronym said: For now, I'd suggest to run without fatal warnings and post-process the compiler output in a build tool. |
@puffnfresh said: |
@retronym said: Another (SBT specific) angle would be to add a hook into: https://github.com/sbt/sbt/blob/0.13/compile/interface/src/main/scala/xsbt/DelegatingReporter.scala to filter to your hearts content. |
@puffnfresh said: def fatalWarningsTask = TaskKey[Unit]("fatalWarnings") <<= Def.task {
fatalWarningsTaskImpl(streams.value, (compile in Compile).value)
}
def fatalWarningsTaskImpl(s: TaskStreams, a: sbt.inc.Analysis) {
def logProblem(l: (=> String) => Unit, f: File, p: xsbti.Problem) = {
l(f.toString + ":" + p.position.line.fold("")(_ + ":") + " " + p.message)
l(p.position.lineContent)
l("")
}
var failed = 0
a.infos.allInfos.foreach { case (k, i) =>
i.reportedProblems foreach { p =>
val deprecation = p.message.contains("is deprecated")
if(!deprecation)
failed = failed + 1
logProblem(if(deprecation) s.log.warn else s.log.error, k, p)
}
}
if(failed > 0)
error("Fatal warnings")
} A total mess. |
@som-snytt said (edited on Sep 1, 2014 12:12:14 PM UTC): Retronym has suggested deprecating a trait, implemented by its companion, and use the module method. I have suggested deprecating a local function that forwards the call, to the same effect. Edit: deprecated locals loophole was closed in 2.11.0-M8. |
@SethTisue said: |
@som-snytt said (edited on Mar 4, 2017 1:19:32 AM UTC): -deprecation:false -Yinline-warnings:false |
@adriaanm said: |
https://github.com/ghik/silencer is useful here |
I really want to make value discarding warnings fatal as I have hit many bugs in production because of it. Sadly, we have a few things we're using deprecated (I do not care about those, for the moment) - so when I run:
I have not turned on the
-deprecation
flag, so I do not expect an error to occur. Can we make this be a warning until that flag is turned on?The text was updated successfully, but these errors were encountered: