-
Notifications
You must be signed in to change notification settings - Fork 92
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
False positive "Empty if statement" #229
Comments
I do not think you should use Maybe this would be better. def checkFoo(things: Future[Seq[String]]): Future[Unit] =
things.transform {
case Success(ts) =>
if (ts.contains("foo"))
Success(())
else
Failure(new Exception("No foo!"))
case f => f
} |
@BalmungSan Thanks for your answer!
and work around the issue. Anyway, this is not the point. The point is: The if statement is not empty, but scapegoat reports it as empty. I consider this a false positive. |
I tried to fix this bug but couldn't because at the build step that Scapegoat runs, the |
Unlike #125, I think scapegoat really finds false positives for the Empty if statement warning.
When defining a function like this:
scapegoat will throw this warning:
The function is supposed to return
Future.unit
in case monadicthings
does contain"foo"
and a failed future otherwise.The text was updated successfully, but these errors were encountered: