spotbugs / discuss

SpotBugs mailing list
6 stars 1 forks source link

spotbugs always returns 0 #89

Closed tosiara closed 4 years ago

tosiara commented 4 years ago

Hi,

Is there a way to get non-zero return value in case issues found?

I'm running like this:

SPOTBUGS_HOME=~/lib/spotbugs-4.0.0 spotbugs -textui -medium .

$? always shows return value is 0

KengoTODA commented 4 years ago

use -exitcode option :)

https://spotbugs.readthedocs.io/en/stable/running.html#project-configuration-options

tosiara commented 4 years ago

As far as I can see this option overrides the zeroand spotbugs will always return the value you provide.

But I'd like to get zero if no findings, and non-zero if there were findings. Like pretty much all security code scans do. Is this possible?

tosiara commented 4 years ago

Ah sorry, miss-read the docs. This option takes no value Looks like this is what I was looking for Thanks