scapegoat-scala/sbt-scapegoat

scapegoat failOnError := false

Opened this issue · 8 comments

Hi,
Is there any way to do NOT fail if an error is found while scapegoat task is executed?
Since I have to upload the scapegoat-report to sonar, wouldn't be better to have this option?
Do you have some example in order to go ahead even if errors are found?
Thanks in advance.

Seems like there is an option to allow some warnings/errors before failing the build, but I could not make it work with 1.0.5. See issue #60

Same here, couldn't make it work.
Is making the build fail on the report intended?
I would expect it to go through so you can send report to sonar as well.

I think this is related to #72 .

Any news on it ? Thanks!

It would be great to have this in place. Any news regarding this? Any workaround?

If you want to upload the report to Sonar you can change the level of Error inspections to Warning. Doing this the run don't fail (even with warnings) and given that what you really want is to see the quality profile of Sonar not the real scapegoat report it "solves the problem".

You can add to you project settings
scalacOptions in Scapegoat ++= Seq("-P:scapegoat:overrideLevels:ArraysInFormat=Warning:CatchNpe=Warning:ComparingFloatingPointTypes=Warning:ComparingUnrelatedTypes=Warning:EitherGet=Warning:EmptyInterpolatedString=Warning:IllegalFormatString=Warning:ImpossibleOptionSizeCondition=Warning:IncorrectNumberOfArgsToFormat=Warning:IncorrectlyNamedExceptions=Warning:LonelySealedTrait=Warning:MapGetAndGetOrElse=Warning:NanComparison=Warning:OptionGet=Warning:OptionSize=Warning:StripMarginOnRegex=Warning:TraversableHead=Warning:TraversableLast=Warning:TryGet=Warning:UnsafeContains=Warning")

Is not the best option but it works at least with Sonar. Anyway as you say, it would be great to have this failOnError := false option instead of doing this hack.

Another workaround is to do sbt scapegoat || true. This will ignore any errors and with the next command you can upload the report to SonarQube.

I can see the situation haven't changed anything.
It's sad, that we have to do those workarounds. I would like to help in order to inject this failOnError := false, but im only a grey-user, who doesn't really know how to Scala :D