Skip to content

Instantly share code, notes, and snippets.

@draganHR
Last active December 6, 2016 12:42
Show Gist options
  • Save draganHR/e5b8b19e9cf53ebb20f1fe5b8c96ce4b to your computer and use it in GitHub Desktop.
Save draganHR/e5b8b19e9cf53ebb20f1fe5b8c96ce4b to your computer and use it in GitHub Desktop.
  • Name: ESLint
  • Link name: ESLint Warnings
  • Trend report name: Trend report name

Regular expression

([^:]+):(\d+):(\d+): ([^\[\]]+)\[([\w-]+)\/([\w-]+)]

Mapping Script

import hudson.plugins.warnings.parser.Warning
import hudson.plugins.analysis.util.model.Priority

String fileName = matcher.group(1)
String lineNumber = matcher.group(2)
String message = matcher.group(4)
String category = matcher.group(6)
String type = matcher.group(5)
Priority priority = type == "Warning" ? Priority.LOW : Priority.HIGH

return new Warning(fileName, Integer.parseInt(lineNumber), type, category, message, priority);

Example Log Message

/examples/functions.js:7:30: Missing space before function parentheses. [Warning/space-before-function-paren]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment