The Groovy script works on the
Matcher
instance that is passed to the script in the variable matcher
. The script must have a single return
value of type edu.hm.hafner.analysis.Issue
. Use the
edu.hm.hafner.analysis.IssueBuilder
instance that is passed to the script in the variable
builder
to create a new issue instance. Additional available variables:
Here is an example that you can use as a starting point for your script. It composes a new warning using
the matcher of the regular expression ^\s*(.*):(\d+):(.*):\s*(.*)$
.
import edu.hm.hafner.analysis.Severity builder.setFileName(matcher.group(1)) .setLineStart(Integer.parseInt(matcher.group(2))) .setSeverity(Severity.WARNING_NORMAL) .setCategory(matcher.group(3)) .setMessage(matcher.group(4)) return builder.build();